introspective_admin 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +75 -0
  5. data/.ruby-version +1 -1
  6. data/.travis.yml +5 -14
  7. data/CHANGELOG.md +37 -28
  8. data/Gemfile +24 -6
  9. data/Gemfile.lock +402 -264
  10. data/README.md +34 -8
  11. data/Rakefile +3 -5
  12. data/introspective_admin.gemspec +29 -44
  13. data/lib/introspective_admin/base.rb +217 -200
  14. data/lib/introspective_admin/version.rb +5 -3
  15. data/lib/introspective_admin.rb +2 -0
  16. data/lib/tasks/introspective_admin_tasks.rake +2 -0
  17. data/spec/admin/company_admin_spec.rb +73 -72
  18. data/spec/admin/job_admin_spec.rb +63 -61
  19. data/spec/admin/location_admin_spec.rb +70 -66
  20. data/spec/admin/location_beacon_admin_spec.rb +75 -73
  21. data/spec/admin/project__admin_spec.rb +73 -71
  22. data/spec/admin/user_admin_spec.rb +65 -64
  23. data/spec/dummy/Gemfile +17 -0
  24. data/spec/dummy/README.rdoc +28 -28
  25. data/spec/dummy/Rakefile +8 -6
  26. data/spec/dummy/app/admin/admin_users.rb +29 -0
  27. data/spec/dummy/app/admin/company_admin.rb +5 -4
  28. data/spec/dummy/app/admin/dashboard.rb +34 -0
  29. data/spec/dummy/app/admin/job_admin.rb +5 -4
  30. data/spec/dummy/app/admin/location_admin.rb +5 -4
  31. data/spec/dummy/app/admin/location_beacon_admin.rb +8 -6
  32. data/spec/dummy/app/admin/project_admin.rb +5 -6
  33. data/spec/dummy/app/admin/role_admin.rb +5 -5
  34. data/spec/dummy/app/admin/user_admin.rb +13 -13
  35. data/spec/dummy/app/assets/config/manifest.js +3 -0
  36. data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
  37. data/spec/dummy/app/assets/javascripts/application.js +13 -13
  38. data/spec/dummy/app/assets/stylesheets/active_admin.scss +17 -0
  39. data/spec/dummy/app/assets/stylesheets/application.css +15 -15
  40. data/spec/dummy/app/controllers/application_controller.rb +10 -8
  41. data/spec/dummy/app/helpers/application_helper.rb +4 -3
  42. data/spec/dummy/app/models/abstract_adapter.rb +20 -12
  43. data/spec/dummy/app/models/admin_user.rb +12 -6
  44. data/spec/dummy/app/models/company.rb +13 -12
  45. data/spec/dummy/app/models/job.rb +10 -10
  46. data/spec/dummy/app/models/locatable.rb +8 -6
  47. data/spec/dummy/app/models/location.rb +27 -26
  48. data/spec/dummy/app/models/location_beacon.rb +19 -19
  49. data/spec/dummy/app/models/location_gps.rb +11 -11
  50. data/spec/dummy/app/models/project.rb +20 -20
  51. data/spec/dummy/app/models/project_job.rb +8 -7
  52. data/spec/dummy/app/models/role.rb +26 -25
  53. data/spec/dummy/app/models/team.rb +10 -9
  54. data/spec/dummy/app/models/team_user.rb +14 -13
  55. data/spec/dummy/app/models/user.rb +72 -68
  56. data/spec/dummy/app/models/user_location.rb +28 -28
  57. data/spec/dummy/app/models/user_project_job.rb +17 -16
  58. data/spec/dummy/app/views/layouts/application.html.erb +13 -13
  59. data/spec/dummy/bin/bundle +5 -3
  60. data/spec/dummy/bin/rails +6 -4
  61. data/spec/dummy/bin/rake +6 -4
  62. data/spec/dummy/bin/setup +31 -29
  63. data/spec/dummy/config/application.rb +35 -34
  64. data/spec/dummy/config/boot.rb +7 -5
  65. data/spec/dummy/config/database.yml +22 -22
  66. data/spec/dummy/config/environment.rb +12 -11
  67. data/spec/dummy/config/environments/development.rb +47 -45
  68. data/spec/dummy/config/environments/production.rb +83 -82
  69. data/spec/dummy/config/environments/test.rb +50 -50
  70. data/spec/dummy/config/initializers/active_admin.rb +8 -7
  71. data/spec/dummy/config/initializers/assets.rb +15 -13
  72. data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -7
  73. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -3
  74. data/spec/dummy/config/initializers/devise.rb +265 -263
  75. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -4
  76. data/spec/dummy/config/initializers/inflections.rb +18 -16
  77. data/spec/dummy/config/initializers/mime_types.rb +6 -4
  78. data/spec/dummy/config/initializers/session_store.rb +5 -3
  79. data/spec/dummy/config/initializers/wrap_parameters.rb +16 -14
  80. data/spec/dummy/config/initializers/zeitwerk.rb +10 -0
  81. data/spec/dummy/config/locales/devise.en.yml +60 -60
  82. data/spec/dummy/config/locales/en.yml +23 -23
  83. data/spec/dummy/config/routes.rb +12 -9
  84. data/spec/dummy/config/secrets.yml +20 -20
  85. data/spec/dummy/config.ru +6 -4
  86. data/spec/dummy/db/development.sqlite3 +0 -0
  87. data/spec/dummy/db/migrate/20141002205024_devise_create_users.rb +43 -42
  88. data/spec/dummy/db/migrate/20141002211055_devise_create_admin_users.rb +49 -48
  89. data/spec/dummy/db/migrate/20141002211057_create_active_admin_comments.rb +21 -19
  90. data/spec/dummy/db/migrate/20141002220722_add_lockable_to_users.rb +10 -8
  91. data/spec/dummy/db/migrate/20150406213646_create_companies.rb +13 -11
  92. data/spec/dummy/db/migrate/20150414213154_add_user_authentication_token.rb +13 -11
  93. data/spec/dummy/db/migrate/20150415222005_create_roles.rb +13 -12
  94. data/spec/dummy/db/migrate/20150505181635_create_chats.rb +11 -9
  95. data/spec/dummy/db/migrate/20150505181636_create_chat_users.rb +13 -11
  96. data/spec/dummy/db/migrate/20150505181640_create_chat_messages.rb +13 -11
  97. data/spec/dummy/db/migrate/20150507191529_create_chat_message_users.rb +13 -11
  98. data/spec/dummy/db/migrate/20150601200526_create_locations.rb +15 -13
  99. data/spec/dummy/db/migrate/20150601200533_create_locatables.rb +12 -10
  100. data/spec/dummy/db/migrate/20150601212924_create_location_beacons.rb +18 -16
  101. data/spec/dummy/db/migrate/20150601213542_create_location_gps.rb +14 -12
  102. data/spec/dummy/db/migrate/20150609201823_create_user_locations.rb +16 -14
  103. data/spec/dummy/db/migrate/20150617232519_create_projects.rb +12 -10
  104. data/spec/dummy/db/migrate/20150617232521_create_jobs.rb +11 -9
  105. data/spec/dummy/db/migrate/20150617232522_create_project_jobs.rb +13 -11
  106. data/spec/dummy/db/migrate/20150623170133_create_user_project_jobs.rb +14 -12
  107. data/spec/dummy/db/migrate/20150701234929_create_teams.rb +13 -11
  108. data/spec/dummy/db/migrate/20150701234930_create_team_users.rb +13 -11
  109. data/spec/dummy/db/migrate/20150727214950_add_confirmable_to_devise.rb +13 -11
  110. data/spec/dummy/db/migrate/20150820190524_add_user_names.rb +8 -6
  111. data/spec/dummy/db/migrate/20150909225019_add_password_to_project.rb +7 -5
  112. data/spec/dummy/db/migrate/20220806003731_add_devise_to_admin_users.rb +50 -0
  113. data/spec/dummy/db/schema.rb +263 -264
  114. data/spec/dummy/public/404.html +67 -67
  115. data/spec/dummy/public/422.html +67 -67
  116. data/spec/dummy/public/500.html +66 -66
  117. data/spec/rails_helper.rb +33 -27
  118. data/spec/support/blueprints.rb +50 -49
  119. data/spec/support/location_helper.rb +28 -29
  120. metadata +21 -252
  121. data/Gemfile.lock.rails4 +0 -256
@@ -1,263 +1,265 @@
1
- require 'devise'
2
- # Use this hook to configure devise mailer, warden hooks and so forth.
3
- # Many of these configuration options can be set straight in your model.
4
- Devise.setup do |config|
5
- # The secret key used by Devise. Devise uses this key to generate
6
- # random tokens. Changing this key will render invalid all existing
7
- # confirmation, reset password and unlock tokens in the database.
8
- # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
9
- # by default. You can change it below and use your own secret key.
10
- config.secret_key = '16f3eba693fcd1a875d60e96961501c7e78eb7167a68bdff3bb0fa14b66f985f0e07cccbb2c38ca105b71a4ab051adf35d5f7b368172e02a138d1cc8966fe530'
11
-
12
- # ==> Mailer Configuration
13
- # Configure the e-mail address which will be shown in Devise::Mailer,
14
- # note that it will be overwritten if you use your own mailer class
15
- # with default "from" parameter.
16
- config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
17
-
18
- # Configure the class responsible to send e-mails.
19
- # config.mailer = 'Devise::Mailer'
20
-
21
- # ==> ORM configuration
22
- # Load and configure the ORM. Supports :active_record (default) and
23
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
24
- # available as additional gems.
25
- require 'devise/orm/active_record'
26
-
27
- # ==> Configuration for any authentication mechanism
28
- # Configure which keys are used when authenticating a user. The default is
29
- # just :email. You can configure it to use [:username, :subdomain], so for
30
- # authenticating a user, both parameters are required. Remember that those
31
- # parameters are used only when authenticating and not when retrieving from
32
- # session. If you need permissions, you should implement that in a before filter.
33
- # You can also supply a hash where the value is a boolean determining whether
34
- # or not authentication should be aborted when the value is not present.
35
- # config.authentication_keys = [:email]
36
-
37
- # Configure parameters from the request object used for authentication. Each entry
38
- # given should be a request method and it will automatically be passed to the
39
- # find_for_authentication method and considered in your model lookup. For instance,
40
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
41
- # The same considerations mentioned for authentication_keys also apply to request_keys.
42
- # config.request_keys = []
43
-
44
- # Configure which authentication keys should be case-insensitive.
45
- # These keys will be downcased upon creating or modifying a user and when used
46
- # to authenticate or find a user. Default is :email.
47
- config.case_insensitive_keys = [:email]
48
-
49
- # Configure which authentication keys should have whitespace stripped.
50
- # These keys will have whitespace before and after removed upon creating or
51
- # modifying a user and when used to authenticate or find a user. Default is :email.
52
- config.strip_whitespace_keys = [:email]
53
-
54
- # Tell if authentication through request.params is enabled. True by default.
55
- # It can be set to an array that will enable params authentication only for the
56
- # given strategies, for example, `config.params_authenticatable = [:database]` will
57
- # enable it only for database (email + password) authentication.
58
- # config.params_authenticatable = true
59
-
60
- # Tell if authentication through HTTP Auth is enabled. False by default.
61
- # It can be set to an array that will enable http authentication only for the
62
- # given strategies, for example, `config.http_authenticatable = [:database]` will
63
- # enable it only for database authentication. The supported strategies are:
64
- # :database = Support basic authentication with authentication key + password
65
- # config.http_authenticatable = false
66
-
67
- # If 401 status code should be returned for AJAX requests. True by default.
68
- # config.http_authenticatable_on_xhr = true
69
-
70
- # The realm used in Http Basic Authentication. 'Application' by default.
71
- # config.http_authentication_realm = 'Application'
72
-
73
- # It will change confirmation, password recovery and other workflows
74
- # to behave the same regardless if the e-mail provided was right or wrong.
75
- # Does not affect registerable.
76
- # config.paranoid = true
77
-
78
- # By default Devise will store the user in session. You can skip storage for
79
- # particular strategies by setting this option.
80
- # Notice that if you are skipping storage for all authentication paths, you
81
- # may want to disable generating routes to Devise's sessions controller by
82
- # passing skip: :sessions to `devise_for` in your config/routes.rb
83
- config.skip_session_storage = [:http_auth]
84
-
85
- # By default, Devise cleans up the CSRF token on authentication to
86
- # avoid CSRF token fixation attacks. This means that, when using AJAX
87
- # requests for sign in and sign up, you need to get a new CSRF token
88
- # from the server. You can disable this option at your own risk.
89
- # config.clean_up_csrf_token_on_authentication = true
90
-
91
- # ==> Configuration for :database_authenticatable
92
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
93
- # using other encryptors, it sets how many times you want the password re-encrypted.
94
- #
95
- # Limiting the stretches to just one in testing will increase the performance of
96
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
97
- # a value less than 10 in other environments. Note that, for bcrypt (the default
98
- # encryptor), the cost increases exponentially with the number of stretches (e.g.
99
- # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
100
- config.stretches = Rails.env.test? ? 1 : 10
101
-
102
- # Setup a pepper to generate the encrypted password.
103
- # config.pepper = '7d483ef48a0c859652bd623cba800fd76a8a45662f246b2dd2602b02635dbdf935ce0384f1c3bf13fdbe23880eab9f5fdf87fa46f92a1f36098f6051313383fe'
104
-
105
- # ==> Configuration for :confirmable
106
- # A period that the user is allowed to access the website even without
107
- # confirming their account. For instance, if set to 2.days, the user will be
108
- # able to access the website for two days without confirming their account,
109
- # access will be blocked just in the third day. Default is 0.days, meaning
110
- # the user cannot access the website without confirming their account.
111
- # config.allow_unconfirmed_access_for = 2.days
112
-
113
- # A period that the user is allowed to confirm their account before their
114
- # token becomes invalid. For example, if set to 3.days, the user can confirm
115
- # their account within 3 days after the mail was sent, but on the fourth day
116
- # their account can't be confirmed with the token any more.
117
- # Default is nil, meaning there is no restriction on how long a user can take
118
- # before confirming their account.
119
- # config.confirm_within = 3.days
120
-
121
- # If true, requires any email changes to be confirmed (exactly the same way as
122
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
123
- # db field (see migrations). Until confirmed, new email is stored in
124
- # unconfirmed_email column, and copied to email column on successful confirmation.
125
- config.reconfirmable = true
126
-
127
- # Defines which key will be used when confirming an account
128
- # config.confirmation_keys = [:email]
129
-
130
- # ==> Configuration for :rememberable
131
- # The time the user will be remembered without asking for credentials again.
132
- # config.remember_for = 2.weeks
133
-
134
- # Invalidates all the remember me tokens when the user signs out.
135
- config.expire_all_remember_me_on_sign_out = true
136
-
137
- # If true, extends the user's remember period when remembered via cookie.
138
- # config.extend_remember_period = false
139
-
140
- # Options to be passed to the created cookie. For instance, you can set
141
- # secure: true in order to force SSL only cookies.
142
- # config.rememberable_options = {}
143
-
144
- # ==> Configuration for :validatable
145
- # Range for password length.
146
- config.password_length = 8..72
147
-
148
- # Email regex used to validate email formats. It simply asserts that
149
- # one (and only one) @ exists in the given string. This is mainly
150
- # to give user feedback and not to assert the e-mail validity.
151
- # config.email_regexp = /\A[^@]+@[^@]+\z/
152
-
153
- # ==> Configuration for :timeoutable
154
- # The time you want to timeout the user session without activity. After this
155
- # time the user will be asked for credentials again. Default is 30 minutes.
156
- # config.timeout_in = 30.minutes
157
-
158
- # ==> Configuration for :lockable
159
- # Defines which strategy will be used to lock an account.
160
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
161
- # :none = No lock strategy. You should handle locking by yourself.
162
- # config.lock_strategy = :failed_attempts
163
-
164
- # Defines which key will be used when locking and unlocking an account
165
- # config.unlock_keys = [:email]
166
-
167
- # Defines which strategy will be used to unlock an account.
168
- # :email = Sends an unlock link to the user email
169
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
170
- # :both = Enables both strategies
171
- # :none = No unlock strategy. You should handle unlocking by yourself.
172
- # config.unlock_strategy = :both
173
-
174
- # Number of authentication tries before locking an account if lock_strategy
175
- # is failed attempts.
176
- # config.maximum_attempts = 20
177
-
178
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
179
- # config.unlock_in = 1.hour
180
-
181
- # Warn on the last attempt before the account is locked.
182
- # config.last_attempt_warning = true
183
-
184
- # ==> Configuration for :recoverable
185
- #
186
- # Defines which key will be used when recovering the password for an account
187
- # config.reset_password_keys = [:email]
188
-
189
- # Time interval you can reset your password with a reset password key.
190
- # Don't put a too small interval or your users won't have the time to
191
- # change their passwords.
192
- config.reset_password_within = 6.hours
193
-
194
- # When set to false, does not sign a user in automatically after their password is
195
- # reset. Defaults to true, so a user is signed in automatically after a reset.
196
- # config.sign_in_after_reset_password = true
197
-
198
- # ==> Configuration for :encryptable
199
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
200
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
201
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
202
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
203
- # REST_AUTH_SITE_KEY to pepper).
204
- #
205
- # Require the `devise-encryptable` gem when using anything other than bcrypt
206
- # config.encryptor = :sha512
207
-
208
- # ==> Scopes configuration
209
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
210
- # "users/sessions/new". It's turned off by default because it's slower if you
211
- # are using only default views.
212
- # config.scoped_views = false
213
-
214
- # Configure the default scope given to Warden. By default it's the first
215
- # devise role declared in your routes (usually :user).
216
- # config.default_scope = :user
217
-
218
- # Set this configuration to false if you want /users/sign_out to sign out
219
- # only the current scope. By default, Devise signs out all scopes.
220
- # config.sign_out_all_scopes = true
221
-
222
- # ==> Navigation configuration
223
- # Lists the formats that should be treated as navigational. Formats like
224
- # :html, should redirect to the sign in page when the user does not have
225
- # access, but formats like :xml or :json, should return 401.
226
- #
227
- # If you have any extra navigational formats, like :iphone or :mobile, you
228
- # should add them to the navigational formats lists.
229
- #
230
- # The "*/*" below is required to match Internet Explorer requests.
231
- # config.navigational_formats = ['*/*', :html]
232
-
233
- # The default HTTP method used to sign out a resource. Default is :delete.
234
- config.sign_out_via = :delete
235
-
236
- # ==> OmniAuth
237
- # Add a new OmniAuth provider. Check the wiki for more information on setting
238
- # up on your models and hooks.
239
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
240
-
241
- # ==> Warden configuration
242
- # If you want to use other strategies, that are not supported by Devise, or
243
- # change the failure app, you can configure them inside the config.warden block.
244
- #
245
- # config.warden do |manager|
246
- # manager.intercept_401 = false
247
- # manager.default_strategies(scope: :user).unshift :some_external_strategy
248
- # end
249
-
250
- # ==> Mountable engine configurations
251
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
252
- # is mountable, there are some extra configurations to be taken into account.
253
- # The following options are available, assuming the engine is mounted as:
254
- #
255
- # mount MyEngine, at: '/my_engine'
256
- #
257
- # The router that invoked `devise_for`, in the example above, would be:
258
- # config.router_name = :my_engine
259
- #
260
- # When using OmniAuth, Devise cannot automatically set OmniAuth path,
261
- # so you need to do it manually. For the users scope, it would be:
262
- # config.omniauth_path_prefix = '/my_engine/users/auth'
263
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'devise'
4
+ # Use this hook to configure devise mailer, warden hooks and so forth.
5
+ # Many of these configuration options can be set straight in your model.
6
+ Devise.setup do |config|
7
+ # The secret key used by Devise. Devise uses this key to generate
8
+ # random tokens. Changing this key will render invalid all existing
9
+ # confirmation, reset password and unlock tokens in the database.
10
+ # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
11
+ # by default. You can change it below and use your own secret key.
12
+ config.secret_key = '16f3eba693fcd1a875d60e96961501c7e78eb7167a68bdff3bb0fa14b66f985f0e07cccbb2c38ca105b71a4ab051adf35d5f7b368172e02a138d1cc8966fe530'
13
+
14
+ # ==> Mailer Configuration
15
+ # Configure the e-mail address which will be shown in Devise::Mailer,
16
+ # note that it will be overwritten if you use your own mailer class
17
+ # with default "from" parameter.
18
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
19
+
20
+ # Configure the class responsible to send e-mails.
21
+ # config.mailer = 'Devise::Mailer'
22
+
23
+ # ==> ORM configuration
24
+ # Load and configure the ORM. Supports :active_record (default) and
25
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
26
+ # available as additional gems.
27
+ require 'devise/orm/active_record'
28
+
29
+ # ==> Configuration for any authentication mechanism
30
+ # Configure which keys are used when authenticating a user. The default is
31
+ # just :email. You can configure it to use [:username, :subdomain], so for
32
+ # authenticating a user, both parameters are required. Remember that those
33
+ # parameters are used only when authenticating and not when retrieving from
34
+ # session. If you need permissions, you should implement that in a before filter.
35
+ # You can also supply a hash where the value is a boolean determining whether
36
+ # or not authentication should be aborted when the value is not present.
37
+ # config.authentication_keys = [:email]
38
+
39
+ # Configure parameters from the request object used for authentication. Each entry
40
+ # given should be a request method and it will automatically be passed to the
41
+ # find_for_authentication method and considered in your model lookup. For instance,
42
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
43
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
44
+ # config.request_keys = []
45
+
46
+ # Configure which authentication keys should be case-insensitive.
47
+ # These keys will be downcased upon creating or modifying a user and when used
48
+ # to authenticate or find a user. Default is :email.
49
+ config.case_insensitive_keys = [:email]
50
+
51
+ # Configure which authentication keys should have whitespace stripped.
52
+ # These keys will have whitespace before and after removed upon creating or
53
+ # modifying a user and when used to authenticate or find a user. Default is :email.
54
+ config.strip_whitespace_keys = [:email]
55
+
56
+ # Tell if authentication through request.params is enabled. True by default.
57
+ # It can be set to an array that will enable params authentication only for the
58
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
59
+ # enable it only for database (email + password) authentication.
60
+ # config.params_authenticatable = true
61
+
62
+ # Tell if authentication through HTTP Auth is enabled. False by default.
63
+ # It can be set to an array that will enable http authentication only for the
64
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
65
+ # enable it only for database authentication. The supported strategies are:
66
+ # :database = Support basic authentication with authentication key + password
67
+ # config.http_authenticatable = false
68
+
69
+ # If 401 status code should be returned for AJAX requests. True by default.
70
+ # config.http_authenticatable_on_xhr = true
71
+
72
+ # The realm used in Http Basic Authentication. 'Application' by default.
73
+ # config.http_authentication_realm = 'Application'
74
+
75
+ # It will change confirmation, password recovery and other workflows
76
+ # to behave the same regardless if the e-mail provided was right or wrong.
77
+ # Does not affect registerable.
78
+ # config.paranoid = true
79
+
80
+ # By default Devise will store the user in session. You can skip storage for
81
+ # particular strategies by setting this option.
82
+ # Notice that if you are skipping storage for all authentication paths, you
83
+ # may want to disable generating routes to Devise's sessions controller by
84
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
85
+ config.skip_session_storage = [:http_auth]
86
+
87
+ # By default, Devise cleans up the CSRF token on authentication to
88
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
89
+ # requests for sign in and sign up, you need to get a new CSRF token
90
+ # from the server. You can disable this option at your own risk.
91
+ # config.clean_up_csrf_token_on_authentication = true
92
+
93
+ # ==> Configuration for :database_authenticatable
94
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
95
+ # using other encryptors, it sets how many times you want the password re-encrypted.
96
+ #
97
+ # Limiting the stretches to just one in testing will increase the performance of
98
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
99
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
100
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
101
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
102
+ config.stretches = Rails.env.test? ? 1 : 10
103
+
104
+ # Setup a pepper to generate the encrypted password.
105
+ # config.pepper = '7d483ef48a0c859652bd623cba800fd76a8a45662f246b2dd2602b02635dbdf935ce0384f1c3bf13fdbe23880eab9f5fdf87fa46f92a1f36098f6051313383fe'
106
+
107
+ # ==> Configuration for :confirmable
108
+ # A period that the user is allowed to access the website even without
109
+ # confirming their account. For instance, if set to 2.days, the user will be
110
+ # able to access the website for two days without confirming their account,
111
+ # access will be blocked just in the third day. Default is 0.days, meaning
112
+ # the user cannot access the website without confirming their account.
113
+ # config.allow_unconfirmed_access_for = 2.days
114
+
115
+ # A period that the user is allowed to confirm their account before their
116
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
117
+ # their account within 3 days after the mail was sent, but on the fourth day
118
+ # their account can't be confirmed with the token any more.
119
+ # Default is nil, meaning there is no restriction on how long a user can take
120
+ # before confirming their account.
121
+ # config.confirm_within = 3.days
122
+
123
+ # If true, requires any email changes to be confirmed (exactly the same way as
124
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
125
+ # db field (see migrations). Until confirmed, new email is stored in
126
+ # unconfirmed_email column, and copied to email column on successful confirmation.
127
+ config.reconfirmable = true
128
+
129
+ # Defines which key will be used when confirming an account
130
+ # config.confirmation_keys = [:email]
131
+
132
+ # ==> Configuration for :rememberable
133
+ # The time the user will be remembered without asking for credentials again.
134
+ # config.remember_for = 2.weeks
135
+
136
+ # Invalidates all the remember me tokens when the user signs out.
137
+ config.expire_all_remember_me_on_sign_out = true
138
+
139
+ # If true, extends the user's remember period when remembered via cookie.
140
+ # config.extend_remember_period = false
141
+
142
+ # Options to be passed to the created cookie. For instance, you can set
143
+ # secure: true in order to force SSL only cookies.
144
+ # config.rememberable_options = {}
145
+
146
+ # ==> Configuration for :validatable
147
+ # Range for password length.
148
+ config.password_length = 8..72
149
+
150
+ # Email regex used to validate email formats. It simply asserts that
151
+ # one (and only one) @ exists in the given string. This is mainly
152
+ # to give user feedback and not to assert the e-mail validity.
153
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
154
+
155
+ # ==> Configuration for :timeoutable
156
+ # The time you want to timeout the user session without activity. After this
157
+ # time the user will be asked for credentials again. Default is 30 minutes.
158
+ # config.timeout_in = 30.minutes
159
+
160
+ # ==> Configuration for :lockable
161
+ # Defines which strategy will be used to lock an account.
162
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
163
+ # :none = No lock strategy. You should handle locking by yourself.
164
+ # config.lock_strategy = :failed_attempts
165
+
166
+ # Defines which key will be used when locking and unlocking an account
167
+ # config.unlock_keys = [:email]
168
+
169
+ # Defines which strategy will be used to unlock an account.
170
+ # :email = Sends an unlock link to the user email
171
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
172
+ # :both = Enables both strategies
173
+ # :none = No unlock strategy. You should handle unlocking by yourself.
174
+ # config.unlock_strategy = :both
175
+
176
+ # Number of authentication tries before locking an account if lock_strategy
177
+ # is failed attempts.
178
+ # config.maximum_attempts = 20
179
+
180
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
181
+ # config.unlock_in = 1.hour
182
+
183
+ # Warn on the last attempt before the account is locked.
184
+ # config.last_attempt_warning = true
185
+
186
+ # ==> Configuration for :recoverable
187
+ #
188
+ # Defines which key will be used when recovering the password for an account
189
+ # config.reset_password_keys = [:email]
190
+
191
+ # Time interval you can reset your password with a reset password key.
192
+ # Don't put a too small interval or your users won't have the time to
193
+ # change their passwords.
194
+ config.reset_password_within = 6.hours
195
+
196
+ # When set to false, does not sign a user in automatically after their password is
197
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
198
+ # config.sign_in_after_reset_password = true
199
+
200
+ # ==> Configuration for :encryptable
201
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
202
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
203
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
204
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
205
+ # REST_AUTH_SITE_KEY to pepper).
206
+ #
207
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
208
+ # config.encryptor = :sha512
209
+
210
+ # ==> Scopes configuration
211
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
212
+ # "users/sessions/new". It's turned off by default because it's slower if you
213
+ # are using only default views.
214
+ # config.scoped_views = false
215
+
216
+ # Configure the default scope given to Warden. By default it's the first
217
+ # devise role declared in your routes (usually :user).
218
+ # config.default_scope = :user
219
+
220
+ # Set this configuration to false if you want /users/sign_out to sign out
221
+ # only the current scope. By default, Devise signs out all scopes.
222
+ # config.sign_out_all_scopes = true
223
+
224
+ # ==> Navigation configuration
225
+ # Lists the formats that should be treated as navigational. Formats like
226
+ # :html, should redirect to the sign in page when the user does not have
227
+ # access, but formats like :xml or :json, should return 401.
228
+ #
229
+ # If you have any extra navigational formats, like :iphone or :mobile, you
230
+ # should add them to the navigational formats lists.
231
+ #
232
+ # The "*/*" below is required to match Internet Explorer requests.
233
+ # config.navigational_formats = ['*/*', :html]
234
+
235
+ # The default HTTP method used to sign out a resource. Default is :delete.
236
+ config.sign_out_via = :delete
237
+
238
+ # ==> OmniAuth
239
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
240
+ # up on your models and hooks.
241
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
242
+
243
+ # ==> Warden configuration
244
+ # If you want to use other strategies, that are not supported by Devise, or
245
+ # change the failure app, you can configure them inside the config.warden block.
246
+ #
247
+ # config.warden do |manager|
248
+ # manager.intercept_401 = false
249
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
250
+ # end
251
+
252
+ # ==> Mountable engine configurations
253
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
254
+ # is mountable, there are some extra configurations to be taken into account.
255
+ # The following options are available, assuming the engine is mounted as:
256
+ #
257
+ # mount MyEngine, at: '/my_engine'
258
+ #
259
+ # The router that invoked `devise_for`, in the example above, would be:
260
+ # config.router_name = :my_engine
261
+ #
262
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
263
+ # so you need to do it manually. For the users scope, it would be:
264
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
265
+ end
@@ -1,4 +1,6 @@
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]
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure sensitive parameters which will be filtered from the log file.
6
+ Rails.application.config.filter_parameters += [:password]
@@ -1,16 +1,18 @@
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
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new inflection rules using the following format. Inflections
6
+ # are locale specific, and you may define rules for as many different
7
+ # locales as you wish. All of these examples are active by default:
8
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
9
+ # inflect.plural /^(ox)$/i, '\1en'
10
+ # inflect.singular /^(ox)en/i, '\1'
11
+ # inflect.irregular 'person', 'people'
12
+ # inflect.uncountable %w( fish sheep )
13
+ # end
14
+
15
+ # These inflection rules are supported but not enabled by default:
16
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
17
+ # inflect.acronym 'RESTful'
18
+ # end
@@ -1,4 +1,6 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new mime types for use in respond_to blocks:
6
+ # Mime::Type.register "text/richtext", :rtf
@@ -1,3 +1,5 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'