milia 0.3.38 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +94 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +3 -16
  6. data/README.md +890 -141
  7. data/Rakefile +1 -55
  8. data/app/controllers/confirmations_controller.rb +101 -0
  9. data/app/controllers/passwords_controller.rb +8 -0
  10. data/app/controllers/registrations_controller.rb +95 -25
  11. data/app/controllers/sessions_controller.rb +13 -0
  12. data/app/views/members/new.html.haml +33 -0
  13. data/doc/gemfile_addition.txt +28 -0
  14. data/doc/manual_sample.sh +816 -0
  15. data/doc/sample.sh +229 -0
  16. data/lib/generators/milia/install_generator.rb +546 -0
  17. data/lib/generators/milia/temp_generator.rb +93 -0
  18. data/lib/generators/milia/templates/initializer.rb +51 -0
  19. data/lib/milia.rb +89 -1
  20. data/lib/milia/base.rb +29 -4
  21. data/lib/milia/control.rb +161 -9
  22. data/lib/milia/invite_member.rb +92 -0
  23. data/lib/milia/password_generator.rb +171 -0
  24. data/lib/milia/railtie.rb +4 -1
  25. data/lib/milia/version.rb +3 -0
  26. data/milia.gemspec +24 -159
  27. data/test/.ruby-gemset +1 -0
  28. data/test/.ruby-version +1 -0
  29. data/test/Gemfile +81 -0
  30. data/test/Gemfile.lock +200 -0
  31. data/test/README.md +83 -0
  32. data/test/{rails_app/Rakefile → Rakefile} +1 -2
  33. data/test/app/assets/javascripts/application.js +16 -0
  34. data/test/app/assets/stylesheets/application.css +13 -0
  35. data/test/app/controllers/application_controller.rb +13 -0
  36. data/test/app/controllers/home_controller.rb +10 -0
  37. data/test/{rails_app/app → app}/helpers/application_helper.rb +0 -0
  38. data/test/app/models/member.rb +34 -0
  39. data/test/app/models/post.rb +14 -0
  40. data/test/{rails_app/app → app}/models/team.rb +3 -2
  41. data/test/{rails_app/app → app}/models/team_asset.rb +1 -1
  42. data/test/app/models/tenant.rb +54 -0
  43. data/test/app/models/user.rb +14 -0
  44. data/test/app/models/zine.rb +8 -0
  45. data/test/{rails_app/app → app}/views/home/index.html.erb +0 -0
  46. data/test/app/views/home/show.html.erb +2 -0
  47. data/test/app/views/layouts/application.html.erb +14 -0
  48. data/test/bin/bundle +3 -0
  49. data/test/bin/rails +4 -0
  50. data/test/bin/rake +4 -0
  51. data/test/config/application.rb +36 -0
  52. data/test/{rails_app/config → config}/boot.rb +0 -2
  53. data/test/config/database.yml +25 -0
  54. data/test/config/environment.rb +5 -0
  55. data/test/config/environments/development.rb +48 -0
  56. data/test/config/environments/production.rb +95 -0
  57. data/test/config/environments/test.rb +42 -0
  58. data/test/{rails_app/config → config}/initializers/backtrace_silencers.rb +0 -0
  59. data/test/{rails_app/config → config}/initializers/devise.rb +84 -36
  60. data/test/config/initializers/filter_parameter_logging.rb +4 -0
  61. data/test/config/initializers/inflections.rb +16 -0
  62. data/test/config/initializers/milia.rb +51 -0
  63. data/test/{rails_app/config → config}/initializers/mime_types.rb +0 -0
  64. data/test/config/initializers/secret_token.rb +12 -0
  65. data/test/config/initializers/session_store.rb +3 -0
  66. data/test/{rails_app/config → config}/initializers/wrap_parameters.rb +6 -6
  67. data/test/config/locales/en.yml +23 -0
  68. data/test/config/routes.rb +77 -0
  69. data/test/{rails_app/db/migrate/20111012060818_add_sessions_table.rb → db/migrate/20111012050200_add_sessions_table.rb} +2 -6
  70. data/test/db/migrate/20111012050340_devise_create_users.rb +48 -0
  71. data/test/{rails_app/db → db}/migrate/20111012050532_create_tenants.rb +3 -1
  72. data/test/db/migrate/20111012050600_create_tenants_users_join_table.rb +8 -0
  73. data/test/db/migrate/20111012050650_create_members.rb +12 -0
  74. data/test/db/migrate/20111012231923_create_posts.rb +12 -0
  75. data/test/{rails_app/db → db}/migrate/20111013050657_create_zines.rb +2 -4
  76. data/test/{rails_app/db → db}/migrate/20111013050753_create_teams.rb +1 -2
  77. data/test/db/migrate/20111013050837_create_team_assets.rb +11 -0
  78. data/test/db/schema.rb +126 -0
  79. data/test/{rails_app/db → db}/seeds.rb +0 -0
  80. data/test/test/controllers/home_controller_test.rb +133 -0
  81. data/test/{rails_app/test → test}/ctlr_test_helper.rb +0 -0
  82. data/test/test/fixtures/members.yml +35 -0
  83. data/test/test/fixtures/posts.yml +96 -0
  84. data/test/test/fixtures/team_assets.yml +30 -0
  85. data/test/test/fixtures/teams.yml +17 -0
  86. data/test/test/fixtures/tenants.yml +12 -0
  87. data/test/test/fixtures/tenants_users.yml +15 -0
  88. data/test/test/fixtures/users.yml +33 -0
  89. data/test/test/fixtures/zines.yml +25 -0
  90. data/test/test/models/member_test.rb +75 -0
  91. data/test/test/models/post_test.rb +66 -0
  92. data/test/test/models/team_test.rb +49 -0
  93. data/test/test/models/tenant_test.rb +228 -0
  94. data/test/test/models/user_test.rb +182 -0
  95. data/test/test/models/zine_test.rb +40 -0
  96. data/test/test/test_helper.rb +31 -0
  97. metadata +199 -154
  98. data/.rvmrc +0 -1
  99. data/Gemfile.lock +0 -115
  100. data/VERSION +0 -1
  101. data/test/helper.rb +0 -18
  102. data/test/rails_app/.gitignore +0 -5
  103. data/test/rails_app/Gemfile +0 -48
  104. data/test/rails_app/Gemfile.lock +0 -168
  105. data/test/rails_app/Gemfile.lock.backup +0 -167
  106. data/test/rails_app/Procfile +0 -1
  107. data/test/rails_app/README +0 -261
  108. data/test/rails_app/app/assets/images/rails.png +0 -0
  109. data/test/rails_app/app/assets/javascripts/application.js +0 -9
  110. data/test/rails_app/app/assets/javascripts/home.js.coffee +0 -3
  111. data/test/rails_app/app/assets/stylesheets/application.css +0 -7
  112. data/test/rails_app/app/assets/stylesheets/home.css.scss +0 -3
  113. data/test/rails_app/app/controllers/application_controller.rb +0 -50
  114. data/test/rails_app/app/controllers/home_controller.rb +0 -7
  115. data/test/rails_app/app/helpers/home_helper.rb +0 -2
  116. data/test/rails_app/app/mailers/.gitkeep +0 -0
  117. data/test/rails_app/app/models/.gitkeep +0 -0
  118. data/test/rails_app/app/models/author.rb +0 -9
  119. data/test/rails_app/app/models/calendar.rb +0 -6
  120. data/test/rails_app/app/models/post.rb +0 -15
  121. data/test/rails_app/app/models/tenant.rb +0 -8
  122. data/test/rails_app/app/models/user.rb +0 -14
  123. data/test/rails_app/app/models/zine.rb +0 -6
  124. data/test/rails_app/app/views/layouts/application.html.erb +0 -12
  125. data/test/rails_app/config.ru +0 -4
  126. data/test/rails_app/config/application.rb +0 -56
  127. data/test/rails_app/config/database.yml +0 -55
  128. data/test/rails_app/config/environment.rb +0 -5
  129. data/test/rails_app/config/environments/development.rb +0 -41
  130. data/test/rails_app/config/environments/production.rb +0 -60
  131. data/test/rails_app/config/environments/test.rb +0 -56
  132. data/test/rails_app/config/initializers/inflections.rb +0 -10
  133. data/test/rails_app/config/initializers/secret_token.rb +0 -7
  134. data/test/rails_app/config/initializers/session_store.rb +0 -8
  135. data/test/rails_app/config/locales/devise.en.yml +0 -58
  136. data/test/rails_app/config/locales/en.yml +0 -5
  137. data/test/rails_app/config/routes.rb +0 -63
  138. data/test/rails_app/db/migrate/20111012050340_devise_create_users.rb +0 -39
  139. data/test/rails_app/db/migrate/20111012050600_create_tenants_users.rb +0 -10
  140. data/test/rails_app/db/migrate/20111012231923_create_posts.rb +0 -15
  141. data/test/rails_app/db/migrate/20111013050558_create_calendars.rb +0 -14
  142. data/test/rails_app/db/migrate/20111013050837_create_team_assets.rb +0 -14
  143. data/test/rails_app/db/migrate/20111013053403_create_authors.rb +0 -13
  144. data/test/rails_app/db/schema.rb +0 -133
  145. data/test/rails_app/lib/assets/.gitkeep +0 -0
  146. data/test/rails_app/lib/tasks/.gitkeep +0 -0
  147. data/test/rails_app/log/.gitkeep +0 -0
  148. data/test/rails_app/public/404.html +0 -26
  149. data/test/rails_app/public/422.html +0 -26
  150. data/test/rails_app/public/500.html +0 -26
  151. data/test/rails_app/public/favicon.ico +0 -0
  152. data/test/rails_app/script/rails +0 -6
  153. data/test/rails_app/test/factories/units_factory.rb +0 -84
  154. data/test/rails_app/test/fixtures/.gitkeep +0 -0
  155. data/test/rails_app/test/functional/.gitkeep +0 -0
  156. data/test/rails_app/test/functional/home_controller_test.rb +0 -10
  157. data/test/rails_app/test/integration/.gitkeep +0 -0
  158. data/test/rails_app/test/performance/browsing_test.rb +0 -12
  159. data/test/rails_app/test/test_helper.rb +0 -119
  160. data/test/rails_app/test/unit/.gitkeep +0 -0
  161. data/test/rails_app/test/unit/author_test.rb +0 -30
  162. data/test/rails_app/test/unit/calendar_test.rb +0 -28
  163. data/test/rails_app/test/unit/helpers/home_helper_test.rb +0 -7
  164. data/test/rails_app/test/unit/post_test.rb +0 -81
  165. data/test/rails_app/test/unit/team_test.rb +0 -30
  166. data/test/rails_app/test/unit/tenant_test.rb +0 -28
  167. data/test/rails_app/test/unit/user_test.rb +0 -26
  168. data/test/rails_app/test/unit/zine_test.rb +0 -28
  169. data/test/rails_app/vendor/assets/stylesheets/.gitkeep +0 -0
  170. data/test/rails_app/vendor/plugins/.gitkeep +0 -0
  171. data/test/rails_app/vendor/plugins/rails_log_stdout/init.rb +0 -43
  172. data/test/test_milia.rb +0 -7
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,51 @@
1
+ # OPTIONAL: Use this as a template for changing milia configuration
2
+ # put it in your config/initializers directory
3
+ # values shown below are the defaults in milia
4
+ Milia.setup do |config|
5
+
6
+ # true if you wish to use a coupon-based option in your sign-up form
7
+ # false to otherwise not expect a coupon attribute in the parameters
8
+ config.use_coupon = true
9
+
10
+ # true if you use recaptcha on your sign-up form;
11
+ # be sure to include the gem 'recaptcha' in your Gemfile
12
+ # false if you do not
13
+ config.use_recaptcha = true
14
+
15
+ # true if action after signing out is to return to the home (root) page
16
+ # false to return to the sign-in form (devise default)
17
+ config.signout_to_root = true
18
+
19
+ # true if you are using airbrake to be notified of exceptions
20
+ # be sure to include the gem 'airbrake' in your Gemfile
21
+ # false if you do not
22
+ # In certain situations, milia will notify airbrake of a situation which
23
+ # is not necessarily an exception: such as if someone attempts to
24
+ # sign up but you're limited new sign ups (such as when in beta mode)
25
+ # then you'll get notified via airbrake of the email of the person
26
+ # attempting the signup (in case you wish to contact them)
27
+ config.use_airbrake = false
28
+
29
+ # use invite_member for devise work-around to invite members
30
+ # ASSUMES User model
31
+ config.use_invite_member = true
32
+
33
+ # whitelist user params list
34
+ # allows an app to expand the permitted attribute list
35
+ # specify each attribute as a symbol
36
+ # example: [:name]
37
+ # config.whitelist_user_params = []
38
+
39
+ # whitelist tenant params list
40
+ # allows an app to expand the permitted attribute list
41
+ # specify each attribute as a symbol
42
+ # example: [:name]
43
+ # config.whitelist_tenant_params = []
44
+
45
+ # whitelist coupon params list
46
+ # allows an app to expand the permitted attribute list
47
+ # specify each attribute as a symbol
48
+ # example: [:coupon]
49
+ # config.whitelist_coupon_params = []
50
+
51
+ end
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Miliatest::Application.config.secret_key_base = '42f28d89f645d0a758edeed938703a7479f51f160de255d78792739eb5ab3796346ef8bc37d9526237208f8a994e0e780a9dbc35c672b5336d19bc718ea9b57f'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Miliatest::Application.config.session_store :cookie_store, key: '_miliatest_session'
@@ -1,14 +1,14 @@
1
1
  # Be sure to restart your server when you modify this file.
2
- #
2
+
3
3
  # This file contains settings for ActionController::ParamsWrapper which
4
4
  # is enabled by default.
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
9
  end
10
10
 
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,77 @@
1
+ Miliatest::Application.routes.draw do
2
+ get "home/welcome", :as => :welcome
3
+ resources :members
4
+
5
+ get "home/index"
6
+ get "home/show"
7
+ root :to => "home#index"
8
+
9
+
10
+ # *MUST* come *BEFORE* devise's definitions (below)
11
+ as :user do
12
+ match '/user/confirmation' => 'milia/confirmations#update', :via => :put, :as => :update_user_confirmation
13
+ end
14
+
15
+ devise_for :users, :controllers => {
16
+ :registrations => "milia/registrations",
17
+ :confirmations => "milia/confirmations",
18
+ :sessions => "milia/sessions",
19
+ :passwords => "milia/passwords",
20
+ }
21
+
22
+
23
+ # The priority is based upon order of creation: first created -> highest priority.
24
+ # See how all your routes lay out with "rake routes".
25
+
26
+ # You can have the root of your site routed with "root"
27
+ # root 'welcome#index'
28
+
29
+ # Example of regular route:
30
+ # get 'products/:id' => 'catalog#view'
31
+
32
+ # Example of named route that can be invoked with purchase_url(id: product.id)
33
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
34
+
35
+ # Example resource route (maps HTTP verbs to controller actions automatically):
36
+ # resources :products
37
+
38
+ # Example resource route with options:
39
+ # resources :products do
40
+ # member do
41
+ # get 'short'
42
+ # post 'toggle'
43
+ # end
44
+ #
45
+ # collection do
46
+ # get 'sold'
47
+ # end
48
+ # end
49
+
50
+ # Example resource route with sub-resources:
51
+ # resources :products do
52
+ # resources :comments, :sales
53
+ # resource :seller
54
+ # end
55
+
56
+ # Example resource route with more complex sub-resources:
57
+ # resources :products do
58
+ # resources :comments
59
+ # resources :sales do
60
+ # get 'recent', on: :collection
61
+ # end
62
+ # end
63
+
64
+ # Example resource route with concerns:
65
+ # concern :toggleable do
66
+ # post 'toggle'
67
+ # end
68
+ # resources :posts, concerns: :toggleable
69
+ # resources :photos, concerns: :toggleable
70
+
71
+ # Example resource route within a namespace:
72
+ # namespace :admin do
73
+ # # Directs /admin/products/* to Admin::ProductsController
74
+ # # (app/controllers/admin/products_controller.rb)
75
+ # resources :products
76
+ # end
77
+ end
@@ -1,16 +1,12 @@
1
1
  class AddSessionsTable < ActiveRecord::Migration
2
- def up
2
+ def change
3
3
  create_table :sessions do |t|
4
4
  t.string :session_id, :null => false
5
5
  t.text :data
6
6
  t.timestamps
7
7
  end
8
8
 
9
- add_index :sessions, :session_id
9
+ add_index :sessions, :session_id, :unique => true
10
10
  add_index :sessions, :updated_at
11
11
  end
12
-
13
- def down
14
- drop_table :sessions
15
- end
16
12
  end
@@ -0,0 +1,48 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0, :null => false
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ t.string :confirmation_token
24
+ t.datetime :confirmed_at
25
+ t.datetime :confirmation_sent_at
26
+ t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+ # milia member_invitable
34
+ t.boolean :skip_confirm_change_password, :default => false
35
+ t.references :tenant
36
+ t.string :authentication_token
37
+
38
+
39
+ t.timestamps
40
+ end
41
+
42
+ add_index :users, :email, :unique => true
43
+ add_index :users, :reset_password_token, :unique => true
44
+ add_index :users, :confirmation_token, :unique => true
45
+ add_index :users, :authentication_token, :unique => true
46
+ # add_index :users, :unlock_token, :unique => true
47
+ end
48
+ end
@@ -1,9 +1,11 @@
1
1
  class CreateTenants < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :tenants do |t|
4
- t.references :tenant
4
+ t.references :tenant, index: true
5
+ t.string :name
5
6
 
6
7
  t.timestamps
7
8
  end
9
+ add_index :tenants, :name
8
10
  end
9
11
  end
@@ -0,0 +1,8 @@
1
+ class CreateTenantsUsersJoinTable < ActiveRecord::Migration
2
+ def change
3
+ create_join_table :tenants, :users do |t|
4
+ t.index [:tenant_id, :user_id]
5
+ # t.index [:user_id, :tenant_id]
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ class CreateMembers < ActiveRecord::Migration
2
+ def change
3
+ create_table :members do |t|
4
+ t.references :tenant, index: true
5
+ t.references :user, index: true
6
+ t.string :first_name
7
+ t.string :last_name
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.references :tenant, index: true
5
+ t.references :member, index: true
6
+ t.references :zine, index: true
7
+ t.string :content
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -1,12 +1,10 @@
1
1
  class CreateZines < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :zines do |t|
4
- t.references :tenant
5
- t.references :calendar
4
+ t.references :tenant, index: true
5
+ t.references :team, index: true
6
6
 
7
7
  t.timestamps
8
8
  end
9
- add_index :zines, :tenant_id
10
- add_index :zines, :calendar_id
11
9
  end
12
10
  end
@@ -1,11 +1,10 @@
1
1
  class CreateTeams < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :teams do |t|
4
- t.references :tenant
4
+ t.references :tenant, index: true
5
5
  t.string :name
6
6
 
7
7
  t.timestamps
8
8
  end
9
- add_index :teams, :tenant_id
10
9
  end
11
10
  end
@@ -0,0 +1,11 @@
1
+ class CreateTeamAssets < ActiveRecord::Migration
2
+ def change
3
+ create_table :team_assets do |t|
4
+ t.references :tenant, index: true
5
+ t.references :member, index: true
6
+ t.references :team, index: true
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,126 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20111013050837) do
15
+
16
+ create_table "members", force: true do |t|
17
+ t.integer "tenant_id"
18
+ t.integer "user_id"
19
+ t.string "first_name"
20
+ t.string "last_name"
21
+ t.datetime "created_at"
22
+ t.datetime "updated_at"
23
+ end
24
+
25
+ add_index "members", ["tenant_id"], name: "index_members_on_tenant_id"
26
+ add_index "members", ["user_id"], name: "index_members_on_user_id"
27
+
28
+ create_table "posts", force: true do |t|
29
+ t.integer "tenant_id"
30
+ t.integer "member_id"
31
+ t.integer "zine_id"
32
+ t.string "content"
33
+ t.datetime "created_at"
34
+ t.datetime "updated_at"
35
+ end
36
+
37
+ add_index "posts", ["member_id"], name: "index_posts_on_member_id"
38
+ add_index "posts", ["tenant_id"], name: "index_posts_on_tenant_id"
39
+ add_index "posts", ["zine_id"], name: "index_posts_on_zine_id"
40
+
41
+ create_table "sessions", force: true do |t|
42
+ t.string "session_id", null: false
43
+ t.text "data"
44
+ t.datetime "created_at"
45
+ t.datetime "updated_at"
46
+ end
47
+
48
+ add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true
49
+ add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at"
50
+
51
+ create_table "team_assets", force: true do |t|
52
+ t.integer "tenant_id"
53
+ t.integer "member_id"
54
+ t.integer "team_id"
55
+ t.datetime "created_at"
56
+ t.datetime "updated_at"
57
+ end
58
+
59
+ add_index "team_assets", ["member_id"], name: "index_team_assets_on_member_id"
60
+ add_index "team_assets", ["team_id"], name: "index_team_assets_on_team_id"
61
+ add_index "team_assets", ["tenant_id"], name: "index_team_assets_on_tenant_id"
62
+
63
+ create_table "teams", force: true do |t|
64
+ t.integer "tenant_id"
65
+ t.string "name"
66
+ t.datetime "created_at"
67
+ t.datetime "updated_at"
68
+ end
69
+
70
+ add_index "teams", ["tenant_id"], name: "index_teams_on_tenant_id"
71
+
72
+ create_table "tenants", force: true do |t|
73
+ t.integer "tenant_id"
74
+ t.string "name"
75
+ t.datetime "created_at"
76
+ t.datetime "updated_at"
77
+ end
78
+
79
+ add_index "tenants", ["name"], name: "index_tenants_on_name"
80
+ add_index "tenants", ["tenant_id"], name: "index_tenants_on_tenant_id"
81
+
82
+ create_table "tenants_users", id: false, force: true do |t|
83
+ t.integer "tenant_id", null: false
84
+ t.integer "user_id", null: false
85
+ end
86
+
87
+ add_index "tenants_users", ["tenant_id", "user_id"], name: "index_tenants_users_on_tenant_id_and_user_id"
88
+
89
+ create_table "users", force: true do |t|
90
+ t.string "email", default: "", null: false
91
+ t.string "encrypted_password", default: "", null: false
92
+ t.string "reset_password_token"
93
+ t.datetime "reset_password_sent_at"
94
+ t.datetime "remember_created_at"
95
+ t.integer "sign_in_count", default: 0, null: false
96
+ t.datetime "current_sign_in_at"
97
+ t.datetime "last_sign_in_at"
98
+ t.string "current_sign_in_ip"
99
+ t.string "last_sign_in_ip"
100
+ t.string "confirmation_token"
101
+ t.datetime "confirmed_at"
102
+ t.datetime "confirmation_sent_at"
103
+ t.string "unconfirmed_email"
104
+ t.boolean "skip_confirm_change_password", default: false
105
+ t.integer "tenant_id"
106
+ t.string "authentication_token"
107
+ t.datetime "created_at"
108
+ t.datetime "updated_at"
109
+ end
110
+
111
+ add_index "users", ["authentication_token"], name: "index_users_on_authentication_token", unique: true
112
+ add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
113
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
114
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
115
+
116
+ create_table "zines", force: true do |t|
117
+ t.integer "tenant_id"
118
+ t.integer "team_id"
119
+ t.datetime "created_at"
120
+ t.datetime "updated_at"
121
+ end
122
+
123
+ add_index "zines", ["team_id"], name: "index_zines_on_team_id"
124
+ add_index "zines", ["tenant_id"], name: "index_zines_on_tenant_id"
125
+
126
+ end