activeadmin-tom_select 4.1.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 (196) hide show
  1. checksums.yaml +7 -0
  2. data/.actrc +20 -0
  3. data/.claude/commands/fix-tests.md +203 -0
  4. data/.github/workflows/ci.yml +174 -0
  5. data/.github/workflows/npm-publish.yml +50 -0
  6. data/.gitignore +35 -0
  7. data/.npmignore +58 -0
  8. data/.rspec +1 -0
  9. data/.rubocop.yml +75 -0
  10. data/.yardopts +2 -0
  11. data/AGENTS.md +39 -0
  12. data/Appraisals +9 -0
  13. data/CHANGELOG.md +64 -0
  14. data/CLAUDE.md +157 -0
  15. data/Gemfile +12 -0
  16. data/Gemfile.lock +368 -0
  17. data/LICENSE.txt +25 -0
  18. data/README.md +483 -0
  19. data/Rakefile +4 -0
  20. data/activeadmin-tom_select.gemspec +43 -0
  21. data/bin/rspec +17 -0
  22. data/config/database.yml +16 -0
  23. data/docs/activeadmin-4-detailed-reference.md +932 -0
  24. data/docs/activeadmin-4-gem-migration-guide.md +313 -0
  25. data/docs/combustion.md +213 -0
  26. data/docs/fail.png +0 -0
  27. data/docs/guide-update-your-app.md +283 -0
  28. data/docs/normal.png +0 -0
  29. data/docs/propshaft-readme.md +320 -0
  30. data/docs/propshaft-upgrade.md +484 -0
  31. data/docs/setup-activeadmin-app.md +552 -0
  32. data/docs/setup-activeadmin-gem.md +535 -0
  33. data/docs/tailwind/blog-page.md +341 -0
  34. data/docs/tailwind/upgrade-guide-enhanced.md +438 -0
  35. data/docs/tailwind/upgrade-guide.md +416 -0
  36. data/docs/tailwind-4/active_admin.rake +38 -0
  37. data/docs/tailwind-4/active_admin.tailwind.css +415 -0
  38. data/docs/tailwind-4/tailwind-active_admin.config.js +18 -0
  39. data/docs/test-app-change.md +154 -0
  40. data/docs/test-environment-fixes.md +58 -0
  41. data/docs/update-tom-select.md +184 -0
  42. data/docs/upload-system.md +225 -0
  43. data/gemfiles/rails_7.x_active_admin_4.x.gemfile +10 -0
  44. data/gemfiles/rails_7.x_active_admin_4.x.gemfile.lock +377 -0
  45. data/gemfiles/rails_8.x_active_admin_4.x.gemfile +10 -0
  46. data/gemfiles/rails_8.x_active_admin_4.x.gemfile.lock +372 -0
  47. data/lefthook.yml +17 -0
  48. data/lib/activeadmin/inputs/filters/searchable_select_input.rb +19 -0
  49. data/lib/activeadmin/inputs/searchable_select_input.rb +16 -0
  50. data/lib/activeadmin/tom_select/engine.rb +17 -0
  51. data/lib/activeadmin/tom_select/option_collection.rb +128 -0
  52. data/lib/activeadmin/tom_select/resource_dsl_extension.rb +56 -0
  53. data/lib/activeadmin/tom_select/resource_extension.rb +10 -0
  54. data/lib/activeadmin/tom_select/select_input_extension.rb +168 -0
  55. data/lib/activeadmin/tom_select/version.rb +5 -0
  56. data/lib/activeadmin/tom_select.rb +20 -0
  57. data/lib/activeadmin-tom_select.rb +5 -0
  58. data/lib/generators/active_admin/tom_select/install/install_generator.rb +180 -0
  59. data/npm-package/package-lock.json +51 -0
  60. data/npm-package/package.json +43 -0
  61. data/npm-package/src/index.js +153 -0
  62. data/npm-package/src/tom-select-tailwind.css +392 -0
  63. data/sonar-project.properties +25 -0
  64. data/spec/features/ajax_params_spec.rb +31 -0
  65. data/spec/features/asset_pipeline_diagnostic_spec.rb +155 -0
  66. data/spec/features/end_to_end_spec.rb +273 -0
  67. data/spec/features/filter_input_spec.rb +144 -0
  68. data/spec/features/form_input_spec.rb +122 -0
  69. data/spec/features/inline_ajax_setting_spec.rb +26 -0
  70. data/spec/features/input_errors_spec.rb +76 -0
  71. data/spec/features/input_html_options_spec.rb +30 -0
  72. data/spec/features/options_dsl_spec.rb +230 -0
  73. data/spec/features/production_build_spec.rb +108 -0
  74. data/spec/internal/.node-version +1 -0
  75. data/spec/internal/Gemfile +43 -0
  76. data/spec/internal/Gemfile.lock +333 -0
  77. data/spec/internal/Procfile.dev +3 -0
  78. data/spec/internal/README.md +24 -0
  79. data/spec/internal/Rakefile +6 -0
  80. data/spec/internal/app/admin/categories.rb +26 -0
  81. data/spec/internal/app/admin/dashboard.rb +29 -0
  82. data/spec/internal/app/admin/option_types.rb +19 -0
  83. data/spec/internal/app/admin/option_values.rb +30 -0
  84. data/spec/internal/app/admin/posts.rb +27 -0
  85. data/spec/internal/app/admin/products.rb +22 -0
  86. data/spec/internal/app/admin/rgb_colors.rb +25 -0
  87. data/spec/internal/app/admin/tag_names.rb +21 -0
  88. data/spec/internal/app/admin/test_ajax_params_category.rb +10 -0
  89. data/spec/internal/app/admin/test_ajax_params_post.rb +20 -0
  90. data/spec/internal/app/admin/test_form_post_class.rb +7 -0
  91. data/spec/internal/app/admin/test_form_post_custom.rb +11 -0
  92. data/spec/internal/app/admin/test_form_post_resource.rb +11 -0
  93. data/spec/internal/app/admin/test_form_post_resource_custom.rb +12 -0
  94. data/spec/internal/app/admin/test_inline_ajax_post.rb +9 -0
  95. data/spec/internal/app/admin/test_input_html_post.rb +11 -0
  96. data/spec/internal/app/admin/test_posts_display_text.rb +9 -0
  97. data/spec/internal/app/admin/test_posts_filter.rb +9 -0
  98. data/spec/internal/app/admin/test_posts_named.rb +9 -0
  99. data/spec/internal/app/admin/test_posts_pagination.rb +9 -0
  100. data/spec/internal/app/admin/test_posts_payload_lambda.rb +11 -0
  101. data/spec/internal/app/admin/test_posts_payload_proc.rb +9 -0
  102. data/spec/internal/app/admin/test_posts_scope_lambda.rb +8 -0
  103. data/spec/internal/app/admin/test_posts_scope_params.rb +8 -0
  104. data/spec/internal/app/admin/test_posts_scope_user.rb +8 -0
  105. data/spec/internal/app/admin/test_posts_text_attr.rb +5 -0
  106. data/spec/internal/app/admin/users.rb +23 -0
  107. data/spec/internal/app/admin/variants.rb +31 -0
  108. data/spec/internal/app/assets/config/manifest.js +2 -0
  109. data/spec/internal/app/assets/images/.keep +0 -0
  110. data/spec/internal/app/assets/stylesheets/active_admin.tailwind.css +16 -0
  111. data/spec/internal/app/assets/stylesheets/application.tailwind.css +15 -0
  112. data/spec/internal/app/controllers/application_controller.rb +9 -0
  113. data/spec/internal/app/controllers/concerns/.keep +0 -0
  114. data/spec/internal/app/helpers/application_helper.rb +2 -0
  115. data/spec/internal/app/javascript/active_admin.js +19 -0
  116. data/spec/internal/app/javascript/application.js +2 -0
  117. data/spec/internal/app/jobs/application_job.rb +7 -0
  118. data/spec/internal/app/mailers/application_mailer.rb +4 -0
  119. data/spec/internal/app/models/admin_user.rb +9 -0
  120. data/spec/internal/app/models/application_record.rb +3 -0
  121. data/spec/internal/app/models/article.rb +12 -0
  122. data/spec/internal/app/models/category.rb +12 -0
  123. data/spec/internal/app/models/color.rb +9 -0
  124. data/spec/internal/app/models/concerns/.keep +0 -0
  125. data/spec/internal/app/models/internal/tag_name.rb +14 -0
  126. data/spec/internal/app/models/internal_tag_name.rb +11 -0
  127. data/spec/internal/app/models/option_type.rb +12 -0
  128. data/spec/internal/app/models/option_value.rb +4 -0
  129. data/spec/internal/app/models/post.rb +15 -0
  130. data/spec/internal/app/models/product.rb +12 -0
  131. data/spec/internal/app/models/rgb_color.rb +16 -0
  132. data/spec/internal/app/models/tag.rb +12 -0
  133. data/spec/internal/app/models/tagging.rb +12 -0
  134. data/spec/internal/app/models/user.rb +12 -0
  135. data/spec/internal/app/models/variant.rb +12 -0
  136. data/spec/internal/app/views/layouts/application.html.erb +28 -0
  137. data/spec/internal/app/views/layouts/mailer.html.erb +13 -0
  138. data/spec/internal/app/views/layouts/mailer.text.erb +1 -0
  139. data/spec/internal/app/views/pwa/manifest.json.erb +22 -0
  140. data/spec/internal/app/views/pwa/service-worker.js +26 -0
  141. data/spec/internal/bin/bundle +117 -0
  142. data/spec/internal/bin/dev +11 -0
  143. data/spec/internal/bin/rackup +27 -0
  144. data/spec/internal/bin/rails +4 -0
  145. data/spec/internal/bin/rake +4 -0
  146. data/spec/internal/bin/setup +37 -0
  147. data/spec/internal/config/application.rb +50 -0
  148. data/spec/internal/config/boot.rb +3 -0
  149. data/spec/internal/config/credentials.yml.enc +1 -0
  150. data/spec/internal/config/database.yml +32 -0
  151. data/spec/internal/config/environment.rb +5 -0
  152. data/spec/internal/config/environments/development.rb +63 -0
  153. data/spec/internal/config/environments/production.rb +86 -0
  154. data/spec/internal/config/environments/test.rb +50 -0
  155. data/spec/internal/config/initializers/active_admin.rb +54 -0
  156. data/spec/internal/config/initializers/assets.rb +8 -0
  157. data/spec/internal/config/initializers/content_security_policy.rb +25 -0
  158. data/spec/internal/config/initializers/devise.rb +315 -0
  159. data/spec/internal/config/initializers/filter_parameter_logging.rb +8 -0
  160. data/spec/internal/config/initializers/inflections.rb +16 -0
  161. data/spec/internal/config/initializers/searchable_select.rb +6 -0
  162. data/spec/internal/config/locales/devise.en.yml +65 -0
  163. data/spec/internal/config/locales/en.yml +31 -0
  164. data/spec/internal/config/master.key +1 -0
  165. data/spec/internal/config/puma.rb +38 -0
  166. data/spec/internal/config/routes.rb +17 -0
  167. data/spec/internal/config.ru +6 -0
  168. data/spec/internal/db/schema.rb +174 -0
  169. data/spec/internal/db/seeds.rb +167 -0
  170. data/spec/internal/esbuild.config.js +34 -0
  171. data/spec/internal/lib/tasks/.keep +0 -0
  172. data/spec/internal/lib/tasks/active_admin.rake +55 -0
  173. data/spec/internal/log/.keep +0 -0
  174. data/spec/internal/package-lock.json +1954 -0
  175. data/spec/internal/package.json +21 -0
  176. data/spec/internal/public/400.html +114 -0
  177. data/spec/internal/public/404.html +114 -0
  178. data/spec/internal/public/406-unsupported-browser.html +114 -0
  179. data/spec/internal/public/422.html +114 -0
  180. data/spec/internal/public/500.html +114 -0
  181. data/spec/internal/public/icon.png +0 -0
  182. data/spec/internal/public/icon.svg +3 -0
  183. data/spec/internal/public/robots.txt +1 -0
  184. data/spec/internal/script/.keep +0 -0
  185. data/spec/internal/storage/.keep +0 -0
  186. data/spec/internal/tailwind.config.js +23 -0
  187. data/spec/internal/vendor/.keep +0 -0
  188. data/spec/internal/yarn.lock +824 -0
  189. data/spec/rails_helper.rb +62 -0
  190. data/spec/spec_helper.rb +138 -0
  191. data/spec/support/active_admin_helpers.rb +17 -0
  192. data/spec/support/capybara.rb +8 -0
  193. data/spec/support/models.rb +11 -0
  194. data/spec/support/pluck_polyfill.rb +12 -0
  195. data/spec/support/reset_settings.rb +5 -0
  196. metadata +497 -0
@@ -0,0 +1,315 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Assuming you have not yet modified this file, each configuration option below
4
+ # is set to its default value. Note that some are commented out while others
5
+ # are not: uncommented lines are intended to protect your configuration from
6
+ # breaking changes in upgrades (i.e., in the event that future versions of
7
+ # Devise change the default values for those options).
8
+ #
9
+ # Use this hook to configure devise mailer, warden hooks and so forth.
10
+ # Many of these configuration options can be set straight in your model.
11
+ Devise.setup do |config|
12
+ # The secret key used by Devise. Devise uses this key to generate
13
+ # random tokens. Changing this key will render invalid all existing
14
+ # confirmation, reset password and unlock tokens in the database.
15
+ # Devise will use the `secret_key_base` as its `secret_key`
16
+ # by default. You can change it below and use your own secret key.
17
+ # config.secret_key = '73475f3dc25c74f9016c37a9b20f444a7e2833053de0433ab30d4208987f5f25' \
18
+ # '231e7787bfda73e1b89ad22d75316d597b8e39c139643325b85c30cad0475688'
19
+
20
+ # ==> Controller configuration
21
+ # Configure the parent class to the devise controllers.
22
+ # config.parent_controller = 'DeviseController'
23
+
24
+ # ==> Mailer Configuration
25
+ # Configure the e-mail address which will be shown in Devise::Mailer,
26
+ # note that it will be overwritten if you use your own mailer class
27
+ # with default "from" parameter.
28
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
29
+
30
+ # Configure the class responsible to send e-mails.
31
+ # config.mailer = 'Devise::Mailer'
32
+
33
+ # Configure the parent class responsible to send e-mails.
34
+ # config.parent_mailer = 'ActionMailer::Base'
35
+
36
+ # ==> ORM configuration
37
+ # Load and configure the ORM. Supports :active_record (default) and
38
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
39
+ # available as additional gems.
40
+ require 'devise/orm/active_record'
41
+
42
+ # ==> Configuration for any authentication mechanism
43
+ # Configure which keys are used when authenticating a user. The default is
44
+ # just :email. You can configure it to use [:username, :subdomain], so for
45
+ # authenticating a user, both parameters are required. Remember that those
46
+ # parameters are used only when authenticating and not when retrieving from
47
+ # session. If you need permissions, you should implement that in a before filter.
48
+ # You can also supply a hash where the value is a boolean determining whether
49
+ # or not authentication should be aborted when the value is not present.
50
+ # config.authentication_keys = [:email]
51
+
52
+ # Configure parameters from the request object used for authentication. Each entry
53
+ # given should be a request method and it will automatically be passed to the
54
+ # find_for_authentication method and considered in your model lookup. For instance,
55
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
56
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
57
+ # config.request_keys = []
58
+
59
+ # Configure which authentication keys should be case-insensitive.
60
+ # These keys will be downcased upon creating or modifying a user and when used
61
+ # to authenticate or find a user. Default is :email.
62
+ config.case_insensitive_keys = [:email]
63
+
64
+ # Configure which authentication keys should have whitespace stripped.
65
+ # These keys will have whitespace before and after removed upon creating or
66
+ # modifying a user and when used to authenticate or find a user. Default is :email.
67
+ config.strip_whitespace_keys = [:email]
68
+
69
+ # Tell if authentication through request.params is enabled. True by default.
70
+ # It can be set to an array that will enable params authentication only for the
71
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
72
+ # enable it only for database (email + password) authentication.
73
+ # config.params_authenticatable = true
74
+
75
+ # Tell if authentication through HTTP Auth is enabled. False by default.
76
+ # It can be set to an array that will enable http authentication only for the
77
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
78
+ # enable it only for database authentication.
79
+ # For API-only applications to support authentication "out-of-the-box", you will likely want to
80
+ # enable this with :database unless you are using a custom strategy.
81
+ # The supported strategies are:
82
+ # :database = Support basic authentication with authentication key + password
83
+ # config.http_authenticatable = false
84
+
85
+ # If 401 status code should be returned for AJAX requests. True by default.
86
+ # config.http_authenticatable_on_xhr = true
87
+
88
+ # The realm used in Http Basic Authentication. 'Application' by default.
89
+ # config.http_authentication_realm = 'Application'
90
+
91
+ # It will change confirmation, password recovery and other workflows
92
+ # to behave the same regardless if the e-mail provided was right or wrong.
93
+ # Does not affect registerable.
94
+ # config.paranoid = true
95
+
96
+ # By default Devise will store the user in session. You can skip storage for
97
+ # particular strategies by setting this option.
98
+ # Notice that if you are skipping storage for all authentication paths, you
99
+ # may want to disable generating routes to Devise's sessions controller by
100
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
101
+ config.skip_session_storage = [:http_auth]
102
+
103
+ # By default, Devise cleans up the CSRF token on authentication to
104
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
105
+ # requests for sign in and sign up, you need to get a new CSRF token
106
+ # from the server. You can disable this option at your own risk.
107
+ # config.clean_up_csrf_token_on_authentication = true
108
+
109
+ # When false, Devise will not attempt to reload routes on eager load.
110
+ # This can reduce the time taken to boot the app but if your application
111
+ # requires the Devise mappings to be loaded during boot time the application
112
+ # won't boot properly.
113
+ # config.reload_routes = true
114
+
115
+ # ==> Configuration for :database_authenticatable
116
+ # For bcrypt, this is the cost for hashing the password and defaults to 12. If
117
+ # using other algorithms, it sets how many times you want the password to be hashed.
118
+ # The number of stretches used for generating the hashed password are stored
119
+ # with the hashed password. This allows you to change the stretches without
120
+ # invalidating existing passwords.
121
+ #
122
+ # Limiting the stretches to just one in testing will increase the performance of
123
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
124
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
125
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
126
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
127
+ config.stretches = Rails.env.test? ? 1 : 12
128
+
129
+ # Set up a pepper to generate the hashed password.
130
+ # config.pepper = '5d07c0d7e9c07281dc93bea10ce9ec16ce81b10529dac76a271ab3f501e1acd2' \
131
+ # '2b1830c086e923e318ad5b7923d70396acf9f26cbae60dabf743b9a416bc5f1a'
132
+
133
+ # Send a notification to the original email when the user's email is changed.
134
+ # config.send_email_changed_notification = false
135
+
136
+ # Send a notification email when the user's password is changed.
137
+ # config.send_password_change_notification = false
138
+
139
+ # ==> Configuration for :confirmable
140
+ # A period that the user is allowed to access the website even without
141
+ # confirming their account. For instance, if set to 2.days, the user will be
142
+ # able to access the website for two days without confirming their account,
143
+ # access will be blocked just in the third day.
144
+ # You can also set it to nil, which will allow the user to access the website
145
+ # without confirming their account.
146
+ # Default is 0.days, meaning the user cannot access the website without
147
+ # confirming their account.
148
+ # config.allow_unconfirmed_access_for = 2.days
149
+
150
+ # A period that the user is allowed to confirm their account before their
151
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
152
+ # their account within 3 days after the mail was sent, but on the fourth day
153
+ # their account can't be confirmed with the token any more.
154
+ # Default is nil, meaning there is no restriction on how long a user can take
155
+ # before confirming their account.
156
+ # config.confirm_within = 3.days
157
+
158
+ # If true, requires any email changes to be confirmed (exactly the same way as
159
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
160
+ # db field (see migrations). Until confirmed, new email is stored in
161
+ # unconfirmed_email column, and copied to email column on successful confirmation.
162
+ config.reconfirmable = true
163
+
164
+ # Defines which key will be used when confirming an account
165
+ # config.confirmation_keys = [:email]
166
+
167
+ # ==> Configuration for :rememberable
168
+ # The time the user will be remembered without asking for credentials again.
169
+ # config.remember_for = 2.weeks
170
+
171
+ # Invalidates all the remember me tokens when the user signs out.
172
+ config.expire_all_remember_me_on_sign_out = true
173
+
174
+ # If true, extends the user's remember period when remembered via cookie.
175
+ # config.extend_remember_period = false
176
+
177
+ # Options to be passed to the created cookie. For instance, you can set
178
+ # secure: true in order to force SSL only cookies.
179
+ # config.rememberable_options = {}
180
+
181
+ # ==> Configuration for :validatable
182
+ # Range for password length.
183
+ config.password_length = 6..128
184
+
185
+ # Email regex used to validate email formats. It simply asserts that
186
+ # one (and only one) @ exists in the given string. This is mainly
187
+ # to give user feedback and not to assert the e-mail validity.
188
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
189
+
190
+ # ==> Configuration for :timeoutable
191
+ # The time you want to timeout the user session without activity. After this
192
+ # time the user will be asked for credentials again. Default is 30 minutes.
193
+ # config.timeout_in = 30.minutes
194
+
195
+ # ==> Configuration for :lockable
196
+ # Defines which strategy will be used to lock an account.
197
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
198
+ # :none = No lock strategy. You should handle locking by yourself.
199
+ # config.lock_strategy = :failed_attempts
200
+
201
+ # Defines which key will be used when locking and unlocking an account
202
+ # config.unlock_keys = [:email]
203
+
204
+ # Defines which strategy will be used to unlock an account.
205
+ # :email = Sends an unlock link to the user email
206
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
207
+ # :both = Enables both strategies
208
+ # :none = No unlock strategy. You should handle unlocking by yourself.
209
+ # config.unlock_strategy = :both
210
+
211
+ # Number of authentication tries before locking an account if lock_strategy
212
+ # is failed attempts.
213
+ # config.maximum_attempts = 20
214
+
215
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
216
+ # config.unlock_in = 1.hour
217
+
218
+ # Warn on the last attempt before the account is locked.
219
+ # config.last_attempt_warning = true
220
+
221
+ # ==> Configuration for :recoverable
222
+ #
223
+ # Defines which key will be used when recovering the password for an account
224
+ # config.reset_password_keys = [:email]
225
+
226
+ # Time interval you can reset your password with a reset password key.
227
+ # Don't put a too small interval or your users won't have the time to
228
+ # change their passwords.
229
+ config.reset_password_within = 6.hours
230
+
231
+ # When set to false, does not sign a user in automatically after their password is
232
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
233
+ # config.sign_in_after_reset_password = true
234
+
235
+ # ==> Configuration for :encryptable
236
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
237
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
238
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
239
+ # for default behavior) and :restful_authentication_sha1 (then you should set
240
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
241
+ #
242
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
243
+ # config.encryptor = :sha512
244
+
245
+ # ==> Scopes configuration
246
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
247
+ # "users/sessions/new". It's turned off by default because it's slower if you
248
+ # are using only default views.
249
+ # config.scoped_views = false
250
+
251
+ # Configure the default scope given to Warden. By default it's the first
252
+ # devise role declared in your routes (usually :user).
253
+ # config.default_scope = :user
254
+
255
+ # Set this configuration to false if you want /users/sign_out to sign out
256
+ # only the current scope. By default, Devise signs out all scopes.
257
+ # config.sign_out_all_scopes = true
258
+
259
+ # ==> Navigation configuration
260
+ # Lists the formats that should be treated as navigational. Formats like
261
+ # :html should redirect to the sign in page when the user does not have
262
+ # access, but formats like :xml or :json, should return 401.
263
+ #
264
+ # If you have any extra navigational formats, like :iphone or :mobile, you
265
+ # should add them to the navigational formats lists.
266
+ #
267
+ # The "*/*" below is required to match Internet Explorer requests.
268
+ # config.navigational_formats = ['*/*', :html, :turbo_stream]
269
+
270
+ # The default HTTP method used to sign out a resource. Default is :delete.
271
+ config.sign_out_via = :delete
272
+
273
+ # ==> OmniAuth
274
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
275
+ # up on your models and hooks.
276
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
277
+
278
+ # ==> Warden configuration
279
+ # If you want to use other strategies, that are not supported by Devise, or
280
+ # change the failure app, you can configure them inside the config.warden block.
281
+ #
282
+ # config.warden do |manager|
283
+ # manager.intercept_401 = false
284
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
285
+ # end
286
+
287
+ # ==> Mountable engine configurations
288
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
289
+ # is mountable, there are some extra configurations to be taken into account.
290
+ # The following options are available, assuming the engine is mounted as:
291
+ #
292
+ # mount MyEngine, at: '/my_engine'
293
+ #
294
+ # The router that invoked `devise_for`, in the example above, would be:
295
+ # config.router_name = :my_engine
296
+ #
297
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
298
+ # so you need to do it manually. For the users scope, it would be:
299
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
300
+
301
+ # ==> Hotwire/Turbo configuration
302
+ # When using Devise with Hotwire/Turbo, the http status for error responses
303
+ # and some redirects must match the following. The default in Devise for existing
304
+ # apps is `200 OK` and `302 Found` respectively, but new apps are generated with
305
+ # these new defaults that match Hotwire/Turbo behavior.
306
+ # Note: These might become the new default in future versions of Devise.
307
+ config.responder.error_status = :unprocessable_entity
308
+ config.responder.redirect_status = :see_other
309
+
310
+ # ==> Configuration for :registerable
311
+
312
+ # When set to false, does not sign a user in automatically after their password is
313
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
314
+ # config.sign_in_after_change_password = true
315
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure parameters to be partially matched (e.g. passw matches password) and
4
+ # filtered from the log file. Use this to limit dissemination of sensitive information.
5
+ # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
+ Rails.application.config.filter_parameters += %i[
7
+ passw email secret token _key crypt salt certificate otp ssn cvv cvc
8
+ ]
@@ -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,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Ensure the Tom Select input is loaded for Formtastic
4
+ Rails.application.config.after_initialize do
5
+ require 'activeadmin/tom_select'
6
+ end
@@ -0,0 +1,65 @@
1
+ # Additional translations at https://github.com/heartcombo/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
+ email_changed:
27
+ subject: "Email Changed"
28
+ password_change:
29
+ subject: "Password Changed"
30
+ omniauth_callbacks:
31
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32
+ success: "Successfully authenticated from %{kind} account."
33
+ passwords:
34
+ 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."
35
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36
+ 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."
37
+ updated: "Your password has been changed successfully. You are now signed in."
38
+ updated_not_active: "Your password has been changed successfully."
39
+ registrations:
40
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41
+ signed_up: "Welcome! You have signed up successfully."
42
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44
+ 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."
45
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
46
+ updated: "Your account has been updated successfully."
47
+ updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
48
+ sessions:
49
+ signed_in: "Signed in successfully."
50
+ signed_out: "Signed out successfully."
51
+ already_signed_out: "Signed out successfully."
52
+ unlocks:
53
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56
+ errors:
57
+ messages:
58
+ already_confirmed: "was already confirmed, please try signing in"
59
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60
+ expired: "has expired, please request a new one"
61
+ not_found: "not found"
62
+ not_locked: "was not locked"
63
+ not_saved:
64
+ one: "1 error prohibited this %{resource} from being saved:"
65
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,31 @@
1
+ # Files in the config/locales directory are used for internationalization and
2
+ # are automatically loaded by Rails. If you want to use locales other than
3
+ # 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 about the API, please read the Rails Internationalization guide
20
+ # at https://guides.rubyonrails.org/i18n.html.
21
+ #
22
+ # Be aware that YAML interprets the following case-insensitive strings as
23
+ # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24
+ # must be quoted to be interpreted as strings. For example:
25
+ #
26
+ # en:
27
+ # "yes": yup
28
+ # enabled: "ON"
29
+
30
+ en:
31
+ hello: "Hello world"
@@ -0,0 +1 @@
1
+ 15d98e11a06ce12bfe034b219c2ee8a6
@@ -0,0 +1,38 @@
1
+ # This configuration file will be evaluated by Puma. The top-level methods that
2
+ # are invoked here are part of Puma's configuration DSL. For more information
3
+ # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
+ #
5
+ # Puma starts a configurable number of processes (workers) and each process
6
+ # serves each request in a thread from an internal thread pool.
7
+ #
8
+ # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9
+ # should only set this value when you want to run 2 or more workers. The
10
+ # default is already 1.
11
+ #
12
+ # The ideal number of threads per worker depends both on how much time the
13
+ # application spends waiting for IO operations and on how much you wish to
14
+ # prioritize throughput over latency.
15
+ #
16
+ # As a rule of thumb, increasing the number of threads will increase how much
17
+ # traffic a given process can handle (throughput), but due to CRuby's
18
+ # Global VM Lock (GVL) it has diminishing returns and will degrade the
19
+ # response time (latency) of the application.
20
+ #
21
+ # The default is set to 3 threads as it's deemed a decent compromise between
22
+ # throughput and latency for the average Rails application.
23
+ #
24
+ # Any libraries that use a connection pool or another resource pool should
25
+ # be configured to provide at least as many connections as the number of
26
+ # threads. This includes Active Record's `pool` parameter in `database.yml`.
27
+ threads_count = ENV.fetch('RAILS_MAX_THREADS', 3)
28
+ threads threads_count, threads_count
29
+
30
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
31
+ port ENV.fetch('PORT', 3000)
32
+
33
+ # Allow puma to be restarted by `bin/rails restart` command.
34
+ plugin :tmp_restart
35
+
36
+ # Specify the PID file. Defaults to tmp/pids/server.pid in development.
37
+ # In other environments, only set the PID file if requested.
38
+ pidfile ENV['PIDFILE'] if ENV['PIDFILE']
@@ -0,0 +1,17 @@
1
+ Rails.application.routes.draw do
2
+ ActiveAdmin.routes(self)
3
+
4
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
5
+
6
+ # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
7
+ # Can be used by load balancers and uptime monitors to verify that the app is live.
8
+ get 'up' => 'rails/health#show', as: :rails_health_check
9
+
10
+ # Render dynamic PWA files from app/views/pwa/*
11
+ # (remember to link manifest in application.html.erb)
12
+ # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
13
+ # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
14
+
15
+ # Defines the root path route ("/")
16
+ root 'admin/dashboard#index'
17
+ end
@@ -0,0 +1,6 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
6
+ Rails.application.load_server