introspective_admin 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +5 -5
  2. data/.DS_Store +0 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +16 -9
  5. data/CHANGELOG.md +28 -15
  6. data/Gemfile +6 -6
  7. data/Gemfile.lock +264 -247
  8. data/Gemfile.lock.rails4 +256 -0
  9. data/introspective_admin.gemspec +44 -41
  10. data/lib/introspective_admin/base.rb +200 -200
  11. data/lib/introspective_admin/version.rb +3 -3
  12. data/spec/admin/company_admin_spec.rb +72 -72
  13. data/spec/admin/job_admin_spec.rb +61 -61
  14. data/spec/admin/location_admin_spec.rb +66 -66
  15. data/spec/admin/location_beacon_admin_spec.rb +73 -73
  16. data/spec/admin/project__admin_spec.rb +71 -71
  17. data/spec/admin/user_admin_spec.rb +64 -64
  18. data/spec/dummy/README.rdoc +28 -28
  19. data/spec/dummy/Rakefile +6 -6
  20. data/spec/dummy/app/admin/company_admin.rb +4 -4
  21. data/spec/dummy/app/admin/job_admin.rb +4 -4
  22. data/spec/dummy/app/admin/location_admin.rb +4 -4
  23. data/spec/dummy/app/admin/location_beacon_admin.rb +6 -6
  24. data/spec/dummy/app/admin/project_admin.rb +6 -6
  25. data/spec/dummy/app/admin/role_admin.rb +5 -5
  26. data/spec/dummy/app/admin/user_admin.rb +13 -13
  27. data/spec/dummy/app/assets/javascripts/application.js +13 -13
  28. data/spec/dummy/app/assets/stylesheets/application.css +15 -15
  29. data/spec/dummy/app/controllers/application_controller.rb +8 -5
  30. data/spec/dummy/app/helpers/application_helper.rb +3 -2
  31. data/spec/dummy/app/models/abstract_adapter.rb +12 -12
  32. data/spec/dummy/app/models/admin_user.rb +6 -6
  33. data/spec/dummy/app/models/company.rb +12 -12
  34. data/spec/dummy/app/models/job.rb +10 -10
  35. data/spec/dummy/app/models/locatable.rb +6 -6
  36. data/spec/dummy/app/models/location.rb +26 -26
  37. data/spec/dummy/app/models/location_beacon.rb +19 -19
  38. data/spec/dummy/app/models/location_gps.rb +11 -11
  39. data/spec/dummy/app/models/project.rb +20 -20
  40. data/spec/dummy/app/models/project_job.rb +7 -7
  41. data/spec/dummy/app/models/role.rb +25 -25
  42. data/spec/dummy/app/models/team.rb +9 -9
  43. data/spec/dummy/app/models/team_user.rb +13 -13
  44. data/spec/dummy/app/models/user.rb +68 -68
  45. data/spec/dummy/app/models/user_location.rb +28 -28
  46. data/spec/dummy/app/models/user_project_job.rb +16 -16
  47. data/spec/dummy/app/views/layouts/application.html.erb +13 -13
  48. data/spec/dummy/bin/bundle +3 -3
  49. data/spec/dummy/bin/rails +4 -4
  50. data/spec/dummy/bin/rake +4 -4
  51. data/spec/dummy/bin/setup +29 -29
  52. data/spec/dummy/config/application.rb +34 -32
  53. data/spec/dummy/config/boot.rb +5 -5
  54. data/spec/dummy/config/database.yml +22 -22
  55. data/spec/dummy/config/environment.rb +11 -11
  56. data/spec/dummy/config/environments/development.rb +45 -41
  57. data/spec/dummy/config/environments/production.rb +82 -79
  58. data/spec/dummy/config/environments/test.rb +50 -43
  59. data/spec/dummy/config/initializers/active_admin.rb +7 -7
  60. data/spec/dummy/config/initializers/assets.rb +13 -11
  61. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  62. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -3
  63. data/spec/dummy/config/initializers/devise.rb +263 -263
  64. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
  65. data/spec/dummy/config/initializers/inflections.rb +16 -16
  66. data/spec/dummy/config/initializers/mime_types.rb +4 -4
  67. data/spec/dummy/config/initializers/session_store.rb +3 -3
  68. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  69. data/spec/dummy/config/locales/devise.en.yml +60 -60
  70. data/spec/dummy/config/locales/en.yml +23 -23
  71. data/spec/dummy/config/routes.rb +9 -9
  72. data/spec/dummy/config/secrets.yml +20 -20
  73. data/spec/dummy/config.ru +4 -4
  74. data/spec/dummy/db/development.sqlite3 +0 -0
  75. data/spec/dummy/db/migrate/20141002205024_devise_create_users.rb +42 -42
  76. data/spec/dummy/db/migrate/20141002211055_devise_create_admin_users.rb +48 -48
  77. data/spec/dummy/db/migrate/20141002211057_create_active_admin_comments.rb +19 -19
  78. data/spec/dummy/db/migrate/20141002220722_add_lockable_to_users.rb +8 -8
  79. data/spec/dummy/db/migrate/20150406213646_create_companies.rb +11 -11
  80. data/spec/dummy/db/migrate/20150414213154_add_user_authentication_token.rb +11 -11
  81. data/spec/dummy/db/migrate/20150415222005_create_roles.rb +12 -12
  82. data/spec/dummy/db/migrate/20150505181635_create_chats.rb +9 -9
  83. data/spec/dummy/db/migrate/20150505181636_create_chat_users.rb +11 -11
  84. data/spec/dummy/db/migrate/20150505181640_create_chat_messages.rb +11 -11
  85. data/spec/dummy/db/migrate/20150507191529_create_chat_message_users.rb +11 -11
  86. data/spec/dummy/db/migrate/20150601200526_create_locations.rb +13 -13
  87. data/spec/dummy/db/migrate/20150601200533_create_locatables.rb +10 -10
  88. data/spec/dummy/db/migrate/20150601212924_create_location_beacons.rb +16 -16
  89. data/spec/dummy/db/migrate/20150601213542_create_location_gps.rb +12 -12
  90. data/spec/dummy/db/migrate/20150609201823_create_user_locations.rb +14 -14
  91. data/spec/dummy/db/migrate/20150617232519_create_projects.rb +10 -10
  92. data/spec/dummy/db/migrate/20150617232521_create_jobs.rb +9 -9
  93. data/spec/dummy/db/migrate/20150617232522_create_project_jobs.rb +11 -11
  94. data/spec/dummy/db/migrate/20150623170133_create_user_project_jobs.rb +12 -12
  95. data/spec/dummy/db/migrate/20150701234929_create_teams.rb +11 -11
  96. data/spec/dummy/db/migrate/20150701234930_create_team_users.rb +11 -11
  97. data/spec/dummy/db/migrate/20150727214950_add_confirmable_to_devise.rb +11 -11
  98. data/spec/dummy/db/migrate/20150820190524_add_user_names.rb +6 -6
  99. data/spec/dummy/db/migrate/20150909225019_add_password_to_project.rb +5 -5
  100. data/spec/dummy/db/schema.rb +264 -264
  101. data/spec/dummy/public/404.html +67 -67
  102. data/spec/dummy/public/422.html +67 -67
  103. data/spec/dummy/public/500.html +66 -66
  104. data/spec/rails_helper.rb +27 -24
  105. metadata +84 -12
@@ -1,60 +1,60 @@
1
- # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
-
3
- en:
4
- devise:
5
- confirmations:
6
- confirmed: "Your email address has been successfully confirmed."
7
- send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
- send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
- failure:
10
- already_authenticated: "You are already signed in."
11
- inactive: "Your account is not activated yet."
12
- invalid: "Invalid %{authentication_keys} or password."
13
- locked: "Your account is locked."
14
- last_attempt: "You have one more attempt before your account is locked."
15
- not_found_in_database: "Invalid %{authentication_keys} or password."
16
- timeout: "Your session expired. Please sign in again to continue."
17
- unauthenticated: "You need to sign in or sign up before continuing."
18
- unconfirmed: "You have to confirm your email address before continuing."
19
- mailer:
20
- confirmation_instructions:
21
- subject: "Confirmation instructions"
22
- reset_password_instructions:
23
- subject: "Reset password instructions"
24
- unlock_instructions:
25
- subject: "Unlock instructions"
26
- omniauth_callbacks:
27
- failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
- success: "Successfully authenticated from %{kind} account."
29
- passwords:
30
- no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
- send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
- send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
- updated: "Your password has been changed successfully. You are now signed in."
34
- updated_not_active: "Your password has been changed successfully."
35
- registrations:
36
- destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
- signed_up: "Welcome! You have signed up successfully."
38
- signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
- signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
- signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41
- update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
42
- updated: "Your account has been updated successfully."
43
- sessions:
44
- signed_in: "Signed in successfully."
45
- signed_out: "Signed out successfully."
46
- already_signed_out: "Signed out successfully."
47
- unlocks:
48
- send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
- send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
- unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
- errors:
52
- messages:
53
- already_confirmed: "was already confirmed, please try signing in"
54
- confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
- expired: "has expired, please request a new one"
56
- not_found: "not found"
57
- not_locked: "was not locked"
58
- not_saved:
59
- one: "1 error prohibited this %{resource} from being saved:"
60
- other: "%{count} errors prohibited this %{resource} from being saved:"
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password has been changed successfully. You are now signed in."
34
+ updated_not_active: "Your password has been changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
42
+ updated: "Your account has been updated successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ already_signed_out: "Signed out successfully."
47
+ unlocks:
48
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
+ errors:
52
+ messages:
53
+ already_confirmed: "was already confirmed, please try signing in"
54
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
+ expired: "has expired, please request a new one"
56
+ not_found: "not found"
57
+ not_locked: "was not locked"
58
+ not_saved:
59
+ one: "1 error prohibited this %{resource} from being saved:"
60
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -1,23 +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"
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"
@@ -1,9 +1,9 @@
1
- Rails.application.routes.draw do
2
- #devise_for :admin_users, ActiveAdmin::Devise.config
3
- devise_for :users
4
- ActiveAdmin.routes(self)
5
-
6
- # You can have the root of your site routed with "root"
7
- root 'home#index'
8
-
9
- end
1
+ Rails.application.routes.draw do
2
+ #devise_for :admin_users, ActiveAdmin::Devise.config
3
+ devise_for :users
4
+ ActiveAdmin.routes(self)
5
+
6
+ # You can have the root of your site routed with "root"
7
+ root 'home#index'
8
+
9
+ end
@@ -1,20 +1,20 @@
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 the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
15
-
16
- test:
17
- secret_key_base: ca9d4587a556cfc28464dcf7f9d73b396e53b814cd339a469bc817011485510d3a9d1d6a7fa08f65cce65bcd55727a7110de0077a952f50ce58a956b255c6903
18
-
19
- production:
20
- secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
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 the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
15
+
16
+ test:
17
+ secret_key_base: ca9d4587a556cfc28464dcf7f9d73b396e53b814cd339a469bc817011485510d3a9d1d6a7fa08f65cce65bcd55727a7110de0077a952f50ce58a956b255c6903
18
+
19
+ production:
20
+ secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
data/spec/dummy/config.ru CHANGED
@@ -1,4 +1,4 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
Binary file
@@ -1,42 +1,42 @@
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
-
34
- t.timestamps null: false
35
- end
36
-
37
- add_index :users, :email, unique: true
38
- add_index :users, :reset_password_token, unique: true
39
- # add_index :users, :confirmation_token, unique: true
40
- # add_index :users, :unlock_token, unique: true
41
- end
42
- end
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
+
34
+ t.timestamps null: false
35
+ end
36
+
37
+ add_index :users, :email, unique: true
38
+ add_index :users, :reset_password_token, unique: true
39
+ # add_index :users, :confirmation_token, unique: true
40
+ # add_index :users, :unlock_token, unique: true
41
+ end
42
+ end
@@ -1,48 +1,48 @@
1
- class DeviseCreateAdminUsers < ActiveRecord::Migration
2
- def migrate(direction)
3
- super
4
- # Create a default user
5
- AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if direction == :up
6
- end
7
-
8
- def change
9
- create_table(:admin_users) do |t|
10
- ## Database authenticatable
11
- t.string :email, null: false, default: ""
12
- t.string :encrypted_password, null: false, default: ""
13
-
14
- ## Recoverable
15
- t.string :reset_password_token
16
- t.datetime :reset_password_sent_at
17
-
18
- ## Rememberable
19
- t.datetime :remember_created_at
20
-
21
- ## Trackable
22
- t.integer :sign_in_count, default: 0, null: false
23
- t.datetime :current_sign_in_at
24
- t.datetime :last_sign_in_at
25
- t.string :current_sign_in_ip
26
- t.string :last_sign_in_ip
27
-
28
- ## Confirmable
29
- # t.string :confirmation_token
30
- # t.datetime :confirmed_at
31
- # t.datetime :confirmation_sent_at
32
- # t.string :unconfirmed_email # Only if using reconfirmable
33
-
34
- ## Lockable
35
- # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
36
- # t.string :unlock_token # Only if unlock strategy is :email or :both
37
- # t.datetime :locked_at
38
-
39
-
40
- t.timestamps null: false
41
- end
42
-
43
- add_index :admin_users, :email, unique: true
44
- add_index :admin_users, :reset_password_token, unique: true
45
- # add_index :admin_users, :confirmation_token, unique: true
46
- # add_index :admin_users, :unlock_token, unique: true
47
- end
48
- end
1
+ class DeviseCreateAdminUsers < ActiveRecord::Migration
2
+ def migrate(direction)
3
+ super
4
+ # Create a default user
5
+ AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if direction == :up
6
+ end
7
+
8
+ def change
9
+ create_table(:admin_users) do |t|
10
+ ## Database authenticatable
11
+ t.string :email, null: false, default: ""
12
+ t.string :encrypted_password, null: false, default: ""
13
+
14
+ ## Recoverable
15
+ t.string :reset_password_token
16
+ t.datetime :reset_password_sent_at
17
+
18
+ ## Rememberable
19
+ t.datetime :remember_created_at
20
+
21
+ ## Trackable
22
+ t.integer :sign_in_count, default: 0, null: false
23
+ t.datetime :current_sign_in_at
24
+ t.datetime :last_sign_in_at
25
+ t.string :current_sign_in_ip
26
+ t.string :last_sign_in_ip
27
+
28
+ ## Confirmable
29
+ # t.string :confirmation_token
30
+ # t.datetime :confirmed_at
31
+ # t.datetime :confirmation_sent_at
32
+ # t.string :unconfirmed_email # Only if using reconfirmable
33
+
34
+ ## Lockable
35
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
36
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
37
+ # t.datetime :locked_at
38
+
39
+
40
+ t.timestamps null: false
41
+ end
42
+
43
+ add_index :admin_users, :email, unique: true
44
+ add_index :admin_users, :reset_password_token, unique: true
45
+ # add_index :admin_users, :confirmation_token, unique: true
46
+ # add_index :admin_users, :unlock_token, unique: true
47
+ end
48
+ end
@@ -1,19 +1,19 @@
1
- class CreateActiveAdminComments < ActiveRecord::Migration
2
- def self.up
3
- create_table :active_admin_comments do |t|
4
- t.string :namespace
5
- t.text :body
6
- t.string :resource_id, null: false, foreign_key: false
7
- t.string :resource_type, null: false
8
- t.references :author, polymorphic: true
9
- t.timestamps null: false
10
- end
11
- add_index :active_admin_comments, [:namespace]
12
- add_index :active_admin_comments, [:author_type, :author_id]
13
- add_index :active_admin_comments, [:resource_type, :resource_id]
14
- end
15
-
16
- def self.down
17
- drop_table :active_admin_comments
18
- end
19
- end
1
+ class CreateActiveAdminComments < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :active_admin_comments do |t|
4
+ t.string :namespace
5
+ t.text :body
6
+ t.string :resource_id, null: false, foreign_key: false
7
+ t.string :resource_type, null: false
8
+ t.references :author, polymorphic: true
9
+ t.timestamps null: false
10
+ end
11
+ add_index :active_admin_comments, [:namespace]
12
+ add_index :active_admin_comments, [:author_type, :author_id]
13
+ add_index :active_admin_comments, [:resource_type, :resource_id]
14
+ end
15
+
16
+ def self.down
17
+ drop_table :active_admin_comments
18
+ end
19
+ end
@@ -1,8 +1,8 @@
1
- class AddLockableToUsers < ActiveRecord::Migration
2
- def change
3
- # add Lockable columns
4
- add_column :users, :failed_attempts, :integer, default: 0, null: false
5
- add_column :users, :unlock_token, :string
6
- add_column :users, :locked_at, :datetime
7
- end
8
- end
1
+ class AddLockableToUsers < ActiveRecord::Migration
2
+ def change
3
+ # add Lockable columns
4
+ add_column :users, :failed_attempts, :integer, default: 0, null: false
5
+ add_column :users, :unlock_token, :string
6
+ add_column :users, :locked_at, :datetime
7
+ end
8
+ end
@@ -1,11 +1,11 @@
1
- class CreateCompanies < ActiveRecord::Migration
2
- def change
3
- create_table :companies do |t|
4
- t.string :name, limit: 256, null: false
5
- t.string :short_name, limit: 10, null: false
6
-
7
- t.timestamps null: false
8
- end
9
- add_index :companies, :name, unique: true
10
- end
11
- end
1
+ class CreateCompanies < ActiveRecord::Migration
2
+ def change
3
+ create_table :companies do |t|
4
+ t.string :name, limit: 256, null: false
5
+ t.string :short_name, limit: 10, null: false
6
+
7
+ t.timestamps null: false
8
+ end
9
+ add_index :companies, :name, unique: true
10
+ end
11
+ end
@@ -1,11 +1,11 @@
1
- class AddUserAuthenticationToken < ActiveRecord::Migration
2
- def change
3
- add_column :users, :authentication_token, :string
4
- add_index :users, :authentication_token, :unique => true
5
- end
6
-
7
- def down
8
- remove_index :users, :authentication_token
9
- remove_column :users, :authentication_token
10
- end
11
- end
1
+ class AddUserAuthenticationToken < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :authentication_token, :string
4
+ add_index :users, :authentication_token, :unique => true
5
+ end
6
+
7
+ def down
8
+ remove_index :users, :authentication_token
9
+ remove_column :users, :authentication_token
10
+ end
11
+ end
@@ -1,12 +1,12 @@
1
- class CreateRoles < ActiveRecord::Migration
2
- def change
3
- create_table :roles do |t|
4
- t.integer :user_id, null: false
5
- t.references :ownable, polymorphic: true, index: true
6
-
7
- t.timestamps null: false
8
- end
9
- add_index :roles, [:user_id,:ownable_type,:ownable_id], unique: true
10
- end
11
-
12
- end
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :roles do |t|
4
+ t.integer :user_id, null: false
5
+ t.references :ownable, polymorphic: true, index: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ add_index :roles, [:user_id,:ownable_type,:ownable_id], unique: true
10
+ end
11
+
12
+ end
@@ -1,9 +1,9 @@
1
- class CreateChats < ActiveRecord::Migration
2
- def change
3
- create_table :chats do |t|
4
- t.integer :creator_id, references: :users, foreign_key: false
5
-
6
- t.timestamps null: false
7
- end
8
- end
9
- end
1
+ class CreateChats < ActiveRecord::Migration
2
+ def change
3
+ create_table :chats do |t|
4
+ t.integer :creator_id, references: :users, foreign_key: false
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -1,11 +1,11 @@
1
- class CreateChatUsers < ActiveRecord::Migration
2
- def change
3
- create_table :chat_users do |t|
4
- t.references :chat, chat: true, index: true, foreign_key: true
5
- t.references :user, index: true, foreign_key: false
6
- t.datetime :departed_at
7
-
8
- t.timestamps null: false
9
- end
10
- end
11
- end
1
+ class CreateChatUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :chat_users do |t|
4
+ t.references :chat, chat: true, index: true, foreign_key: true
5
+ t.references :user, index: true, foreign_key: false
6
+ t.datetime :departed_at
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -1,11 +1,11 @@
1
- class CreateChatMessages < ActiveRecord::Migration
2
- def change
3
- create_table :chat_messages do |t|
4
- t.references :chat, chat: true, index: true, foreign_key: true
5
- t.integer :author_id, references: :users, index: true, foreign_key: false
6
- t.text :message
7
-
8
- t.timestamps null: false
9
- end
10
- end
11
- end
1
+ class CreateChatMessages < ActiveRecord::Migration
2
+ def change
3
+ create_table :chat_messages do |t|
4
+ t.references :chat, chat: true, index: true, foreign_key: true
5
+ t.integer :author_id, references: :users, index: true, foreign_key: false
6
+ t.text :message
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -1,11 +1,11 @@
1
- class CreateChatMessageUsers < ActiveRecord::Migration
2
- def change
3
- create_table :chat_message_users do |t|
4
- t.references :chat_message, index: true, foreign_key: true
5
- t.references :user, index: true, foreign_key: false
6
- t.timestamp :read_at
7
-
8
- t.timestamps null: false
9
- end
10
- end
11
- end
1
+ class CreateChatMessageUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :chat_message_users do |t|
4
+ t.references :chat_message, index: true, foreign_key: true
5
+ t.references :user, index: true, foreign_key: false
6
+ t.timestamp :read_at
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end