activity_notification 2.4.1 → 2.5.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 (250) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/app/jobs/activity_notification/cascading_notification_job.rb +123 -0
  4. data/docs/Functions.md +197 -1
  5. data/lib/activity_notification/apis/cascading_notification_api.rb +208 -0
  6. data/lib/activity_notification/apis/notification_api.rb +3 -0
  7. data/lib/activity_notification/config.rb +10 -0
  8. data/lib/activity_notification/mailers/helpers.rb +27 -1
  9. data/lib/activity_notification/version.rb +1 -1
  10. data/lib/generators/templates/activity_notification.rb +8 -0
  11. metadata +5 -441
  12. data/.codeclimate.yml +0 -33
  13. data/.coveralls.yml +0 -1
  14. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -22
  15. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  16. data/.github/pull_request_template.md +0 -13
  17. data/.github/workflows/build.yml +0 -100
  18. data/.gitignore +0 -74
  19. data/.rspec +0 -3
  20. data/.rubocop.yml +0 -1157
  21. data/.yardopts +0 -6
  22. data/CHANGELOG.md +0 -452
  23. data/Gemfile +0 -31
  24. data/Procfile +0 -2
  25. data/Rakefile +0 -28
  26. data/activity_notification.gemspec +0 -44
  27. data/ai-curated-specs/issues/172/design.md +0 -220
  28. data/ai-curated-specs/issues/172/tasks.md +0 -326
  29. data/ai-curated-specs/issues/188/design.md +0 -227
  30. data/ai-curated-specs/issues/188/requirements.md +0 -78
  31. data/ai-curated-specs/issues/188/tasks.md +0 -203
  32. data/ai-curated-specs/issues/188/upstream-contributions.md +0 -592
  33. data/ai-curated-specs/issues/50/design.md +0 -235
  34. data/ai-curated-specs/issues/50/requirements.md +0 -49
  35. data/ai-curated-specs/issues/50/tasks.md +0 -232
  36. data/bin/_dynamodblocal +0 -4
  37. data/bin/bundle_update.sh +0 -7
  38. data/bin/deploy_on_heroku.sh +0 -16
  39. data/bin/install_dynamodblocal.sh +0 -5
  40. data/bin/start_dynamodblocal.sh +0 -47
  41. data/bin/stop_dynamodblocal.sh +0 -34
  42. data/gemfiles/Gemfile.rails-5.0 +0 -25
  43. data/gemfiles/Gemfile.rails-5.1 +0 -25
  44. data/gemfiles/Gemfile.rails-5.2 +0 -24
  45. data/gemfiles/Gemfile.rails-6.0 +0 -23
  46. data/gemfiles/Gemfile.rails-6.1 +0 -22
  47. data/gemfiles/Gemfile.rails-7.0 +0 -25
  48. data/gemfiles/Gemfile.rails-7.1 +0 -23
  49. data/gemfiles/Gemfile.rails-7.2 +0 -23
  50. data/gemfiles/Gemfile.rails-8.0 +0 -24
  51. data/package.json +0 -8
  52. data/spec/channels/notification_api_channel_shared_examples.rb +0 -59
  53. data/spec/channels/notification_api_channel_spec.rb +0 -49
  54. data/spec/channels/notification_api_with_devise_channel_spec.rb +0 -76
  55. data/spec/channels/notification_channel_shared_examples.rb +0 -59
  56. data/spec/channels/notification_channel_spec.rb +0 -48
  57. data/spec/channels/notification_with_devise_channel_spec.rb +0 -97
  58. data/spec/concerns/apis/notification_api_spec.rb +0 -1627
  59. data/spec/concerns/apis/subscription_api_spec.rb +0 -474
  60. data/spec/concerns/common_spec.rb +0 -213
  61. data/spec/concerns/models/group_spec.rb +0 -61
  62. data/spec/concerns/models/notifiable_spec.rb +0 -782
  63. data/spec/concerns/models/notifier_spec.rb +0 -71
  64. data/spec/concerns/models/subscriber_spec.rb +0 -800
  65. data/spec/concerns/models/target_spec.rb +0 -1285
  66. data/spec/concerns/renderable_spec.rb +0 -129
  67. data/spec/config_spec.rb +0 -85
  68. data/spec/controllers/common_controller_spec.rb +0 -25
  69. data/spec/controllers/controller_spec_utility.rb +0 -100
  70. data/spec/controllers/dummy_common_controller.rb +0 -5
  71. data/spec/controllers/notifications_api_controller_shared_examples.rb +0 -619
  72. data/spec/controllers/notifications_api_controller_spec.rb +0 -19
  73. data/spec/controllers/notifications_api_with_devise_controller_spec.rb +0 -60
  74. data/spec/controllers/notifications_controller_shared_examples.rb +0 -743
  75. data/spec/controllers/notifications_controller_spec.rb +0 -11
  76. data/spec/controllers/notifications_with_devise_controller_spec.rb +0 -97
  77. data/spec/controllers/subscriptions_api_controller_shared_examples.rb +0 -750
  78. data/spec/controllers/subscriptions_api_controller_spec.rb +0 -19
  79. data/spec/controllers/subscriptions_api_with_devise_controller_spec.rb +0 -60
  80. data/spec/controllers/subscriptions_controller_shared_examples.rb +0 -946
  81. data/spec/controllers/subscriptions_controller_spec.rb +0 -11
  82. data/spec/controllers/subscriptions_with_devise_controller_spec.rb +0 -97
  83. data/spec/factories/admins.rb +0 -5
  84. data/spec/factories/articles.rb +0 -5
  85. data/spec/factories/comments.rb +0 -6
  86. data/spec/factories/dummy/dummy_group.rb +0 -4
  87. data/spec/factories/dummy/dummy_notifiable.rb +0 -4
  88. data/spec/factories/dummy/dummy_notifier.rb +0 -4
  89. data/spec/factories/dummy/dummy_subscriber.rb +0 -4
  90. data/spec/factories/dummy/dummy_target.rb +0 -4
  91. data/spec/factories/notifications.rb +0 -7
  92. data/spec/factories/subscriptions.rb +0 -8
  93. data/spec/factories/users.rb +0 -11
  94. data/spec/generators/controllers_generator_spec.rb +0 -85
  95. data/spec/generators/install_generator_spec.rb +0 -43
  96. data/spec/generators/migration/migration_generator_spec.rb +0 -80
  97. data/spec/generators/models_generator_spec.rb +0 -96
  98. data/spec/generators/views_generator_spec.rb +0 -195
  99. data/spec/helpers/polymorphic_helpers_spec.rb +0 -89
  100. data/spec/helpers/view_helpers_spec.rb +0 -547
  101. data/spec/jobs/notification_resilience_job_spec.rb +0 -167
  102. data/spec/jobs/notify_all_job_spec.rb +0 -23
  103. data/spec/jobs/notify_job_spec.rb +0 -23
  104. data/spec/jobs/notify_to_job_spec.rb +0 -23
  105. data/spec/mailers/mailer_spec.rb +0 -214
  106. data/spec/mailers/notification_resilience_spec.rb +0 -263
  107. data/spec/models/dummy/dummy_group_spec.rb +0 -10
  108. data/spec/models/dummy/dummy_notifiable_spec.rb +0 -10
  109. data/spec/models/dummy/dummy_notifier_spec.rb +0 -10
  110. data/spec/models/dummy/dummy_subscriber_spec.rb +0 -8
  111. data/spec/models/dummy/dummy_target_spec.rb +0 -10
  112. data/spec/models/notification_spec.rb +0 -472
  113. data/spec/models/subscription_spec.rb +0 -215
  114. data/spec/optional_targets/action_cable_api_channel_spec.rb +0 -34
  115. data/spec/optional_targets/action_cable_channel_spec.rb +0 -41
  116. data/spec/optional_targets/amazon_sns_spec.rb +0 -47
  117. data/spec/optional_targets/base_spec.rb +0 -45
  118. data/spec/optional_targets/slack_spec.rb +0 -44
  119. data/spec/orm/dynamoid_spec.rb +0 -115
  120. data/spec/rails_app/Rakefile +0 -15
  121. data/spec/rails_app/app/assets/config/manifest.js +0 -3
  122. data/spec/rails_app/app/assets/images/.keep +0 -0
  123. data/spec/rails_app/app/assets/javascripts/application.js +0 -3
  124. data/spec/rails_app/app/assets/javascripts/cable.js +0 -12
  125. data/spec/rails_app/app/assets/stylesheets/application.css +0 -15
  126. data/spec/rails_app/app/assets/stylesheets/reset.css +0 -85
  127. data/spec/rails_app/app/assets/stylesheets/style.css +0 -244
  128. data/spec/rails_app/app/controllers/admins_controller.rb +0 -21
  129. data/spec/rails_app/app/controllers/application_controller.rb +0 -5
  130. data/spec/rails_app/app/controllers/articles_controller.rb +0 -67
  131. data/spec/rails_app/app/controllers/comments_controller.rb +0 -36
  132. data/spec/rails_app/app/controllers/concerns/.keep +0 -0
  133. data/spec/rails_app/app/controllers/spa_controller.rb +0 -7
  134. data/spec/rails_app/app/controllers/users/notifications_controller.rb +0 -2
  135. data/spec/rails_app/app/controllers/users/notifications_with_devise_controller.rb +0 -2
  136. data/spec/rails_app/app/controllers/users/subscriptions_controller.rb +0 -2
  137. data/spec/rails_app/app/controllers/users/subscriptions_with_devise_controller.rb +0 -2
  138. data/spec/rails_app/app/controllers/users_controller.rb +0 -26
  139. data/spec/rails_app/app/helpers/application_helper.rb +0 -2
  140. data/spec/rails_app/app/helpers/devise_helper.rb +0 -2
  141. data/spec/rails_app/app/javascript/App.vue +0 -40
  142. data/spec/rails_app/app/javascript/components/DeviseTokenAuth.vue +0 -82
  143. data/spec/rails_app/app/javascript/components/Top.vue +0 -98
  144. data/spec/rails_app/app/javascript/components/notifications/Index.vue +0 -200
  145. data/spec/rails_app/app/javascript/components/notifications/Notification.vue +0 -133
  146. data/spec/rails_app/app/javascript/components/notifications/NotificationContent.vue +0 -122
  147. data/spec/rails_app/app/javascript/components/subscriptions/Index.vue +0 -279
  148. data/spec/rails_app/app/javascript/components/subscriptions/NewSubscription.vue +0 -112
  149. data/spec/rails_app/app/javascript/components/subscriptions/NotificationKey.vue +0 -141
  150. data/spec/rails_app/app/javascript/components/subscriptions/Subscription.vue +0 -226
  151. data/spec/rails_app/app/javascript/config/development.js +0 -5
  152. data/spec/rails_app/app/javascript/config/environment.js +0 -7
  153. data/spec/rails_app/app/javascript/config/production.js +0 -5
  154. data/spec/rails_app/app/javascript/config/test.js +0 -5
  155. data/spec/rails_app/app/javascript/packs/application.js +0 -18
  156. data/spec/rails_app/app/javascript/packs/spa.js +0 -14
  157. data/spec/rails_app/app/javascript/router/index.js +0 -73
  158. data/spec/rails_app/app/javascript/store/index.js +0 -37
  159. data/spec/rails_app/app/mailers/.keep +0 -0
  160. data/spec/rails_app/app/mailers/custom_notification_mailer.rb +0 -5
  161. data/spec/rails_app/app/models/admin.rb +0 -35
  162. data/spec/rails_app/app/models/article.rb +0 -54
  163. data/spec/rails_app/app/models/comment.rb +0 -81
  164. data/spec/rails_app/app/models/dummy/dummy_base.rb +0 -11
  165. data/spec/rails_app/app/models/dummy/dummy_group.rb +0 -23
  166. data/spec/rails_app/app/models/dummy/dummy_notifiable.rb +0 -15
  167. data/spec/rails_app/app/models/dummy/dummy_notifiable_target.rb +0 -27
  168. data/spec/rails_app/app/models/dummy/dummy_notifier.rb +0 -15
  169. data/spec/rails_app/app/models/dummy/dummy_subscriber.rb +0 -14
  170. data/spec/rails_app/app/models/dummy/dummy_target.rb +0 -16
  171. data/spec/rails_app/app/models/user.rb +0 -73
  172. data/spec/rails_app/app/views/activity_notification/mailer/dummy_subscribers/test_key.text.erb +0 -1
  173. data/spec/rails_app/app/views/activity_notification/notifications/default/article/_update.html.erb +0 -146
  174. data/spec/rails_app/app/views/activity_notification/notifications/default/custom/_path_test.html.erb +0 -1
  175. data/spec/rails_app/app/views/activity_notification/notifications/default/custom/_test.html.erb +0 -1
  176. data/spec/rails_app/app/views/activity_notification/notifications/users/_custom_index.html.erb +0 -1
  177. data/spec/rails_app/app/views/activity_notification/notifications/users/custom/_test.html.erb +0 -1
  178. data/spec/rails_app/app/views/activity_notification/notifications/users/overridden/custom/_test.html.erb +0 -1
  179. data/spec/rails_app/app/views/activity_notification/optional_targets/admins/amazon_sns/comment/_default.text.erb +0 -10
  180. data/spec/rails_app/app/views/articles/_form.html.erb +0 -24
  181. data/spec/rails_app/app/views/articles/edit.html.erb +0 -8
  182. data/spec/rails_app/app/views/articles/index.html.erb +0 -113
  183. data/spec/rails_app/app/views/articles/new.html.erb +0 -7
  184. data/spec/rails_app/app/views/articles/show.html.erb +0 -49
  185. data/spec/rails_app/app/views/layouts/_header.html.erb +0 -46
  186. data/spec/rails_app/app/views/layouts/application.html.erb +0 -15
  187. data/spec/rails_app/app/views/spa/index.html.erb +0 -2
  188. data/spec/rails_app/babel.config.js +0 -72
  189. data/spec/rails_app/bin/bundle +0 -3
  190. data/spec/rails_app/bin/rails +0 -4
  191. data/spec/rails_app/bin/rake +0 -4
  192. data/spec/rails_app/bin/setup +0 -29
  193. data/spec/rails_app/bin/webpack +0 -18
  194. data/spec/rails_app/bin/webpack-dev-server +0 -18
  195. data/spec/rails_app/config/application.rb +0 -54
  196. data/spec/rails_app/config/boot.rb +0 -5
  197. data/spec/rails_app/config/cable.yml +0 -8
  198. data/spec/rails_app/config/database.yml +0 -36
  199. data/spec/rails_app/config/dynamoid.rb +0 -13
  200. data/spec/rails_app/config/environment.rb +0 -26
  201. data/spec/rails_app/config/environments/development.rb +0 -60
  202. data/spec/rails_app/config/environments/production.rb +0 -85
  203. data/spec/rails_app/config/environments/test.rb +0 -53
  204. data/spec/rails_app/config/initializers/activity_notification.rb +0 -104
  205. data/spec/rails_app/config/initializers/assets.rb +0 -11
  206. data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  207. data/spec/rails_app/config/initializers/cookies_serializer.rb +0 -3
  208. data/spec/rails_app/config/initializers/copy_it.aws.rb.template +0 -6
  209. data/spec/rails_app/config/initializers/devise.rb +0 -278
  210. data/spec/rails_app/config/initializers/devise_token_auth.rb +0 -55
  211. data/spec/rails_app/config/initializers/filter_parameter_logging.rb +0 -4
  212. data/spec/rails_app/config/initializers/inflections.rb +0 -16
  213. data/spec/rails_app/config/initializers/mime_types.rb +0 -4
  214. data/spec/rails_app/config/initializers/mysql.rb +0 -9
  215. data/spec/rails_app/config/initializers/session_store.rb +0 -3
  216. data/spec/rails_app/config/initializers/wrap_parameters.rb +0 -14
  217. data/spec/rails_app/config/initializers/zeitwerk.rb +0 -10
  218. data/spec/rails_app/config/locales/activity_notification.en.yml +0 -26
  219. data/spec/rails_app/config/locales/devise.en.yml +0 -62
  220. data/spec/rails_app/config/mongoid.yml +0 -13
  221. data/spec/rails_app/config/routes.rb +0 -50
  222. data/spec/rails_app/config/secrets.yml +0 -22
  223. data/spec/rails_app/config/webpack/development.js +0 -5
  224. data/spec/rails_app/config/webpack/environment.js +0 -7
  225. data/spec/rails_app/config/webpack/loaders/vue.js +0 -6
  226. data/spec/rails_app/config/webpack/production.js +0 -5
  227. data/spec/rails_app/config/webpack/test.js +0 -5
  228. data/spec/rails_app/config/webpacker.yml +0 -97
  229. data/spec/rails_app/config.ru +0 -4
  230. data/spec/rails_app/db/migrate/20160716000000_create_test_tables.rb +0 -42
  231. data/spec/rails_app/db/migrate/20181209000000_create_activity_notification_tables.rb +0 -33
  232. data/spec/rails_app/db/migrate/20191201000000_add_tokens_to_users.rb +0 -10
  233. data/spec/rails_app/db/schema.rb +0 -98
  234. data/spec/rails_app/db/seeds.rb +0 -95
  235. data/spec/rails_app/lib/custom_optional_targets/console_output.rb +0 -16
  236. data/spec/rails_app/lib/custom_optional_targets/raise_error.rb +0 -14
  237. data/spec/rails_app/lib/custom_optional_targets/wrong_target.rb +0 -13
  238. data/spec/rails_app/lib/mailer_previews/mailer_preview.rb +0 -29
  239. data/spec/rails_app/package.json +0 -23
  240. data/spec/rails_app/postcss.config.js +0 -12
  241. data/spec/rails_app/public/404.html +0 -67
  242. data/spec/rails_app/public/422.html +0 -67
  243. data/spec/rails_app/public/500.html +0 -66
  244. data/spec/rails_app/public/favicon.ico +0 -0
  245. data/spec/roles/acts_as_group_spec.rb +0 -30
  246. data/spec/roles/acts_as_notifiable_spec.rb +0 -432
  247. data/spec/roles/acts_as_notifier_spec.rb +0 -30
  248. data/spec/roles/acts_as_target_spec.rb +0 -36
  249. data/spec/spec_helper.rb +0 -56
  250. data/spec/version_spec.rb +0 -31
@@ -1,278 +0,0 @@
1
- # Use this hook to configure devise mailer, warden hooks and so forth.
2
- # Many of these configuration options can be set straight in your model.
3
- Devise.setup do |config|
4
- # The secret key used by Devise. Devise uses this key to generate
5
- # random tokens. Changing this key will render invalid all existing
6
- # confirmation, reset password and unlock tokens in the database.
7
- # Devise will use the `secret_key_base` as its `secret_key`
8
- # by default. You can change it below and use your own secret key.
9
- config.secret_key = 'e6f62a5ffa4bd32a1c36f12c77f3ba071e2f7de683ef0f20f91e0fe53fbf5eda4a8600800250460280a816d151fdab45fe044ef7f0dae0e18b5cac241cfebaef'
10
-
11
- # ==> Mailer Configuration
12
- # Configure the e-mail address which will be shown in Devise::Mailer,
13
- # note that it will be overwritten if you use your own mailer class
14
- # with default "from" parameter.
15
- config.mailer_sender = 'please-change-me@example.com'
16
-
17
- # Configure the class responsible to send e-mails.
18
- # config.mailer = 'Devise::Mailer'
19
-
20
- # Configure the parent class responsible to send e-mails.
21
- # config.parent_mailer = 'ActionMailer::Base'
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
- if ENV['AN_TEST_DB'] == 'mongodb'
28
- require 'devise/orm/mongoid'
29
- else
30
- require 'devise/orm/active_record'
31
- end
32
-
33
- # ==> Configuration for any authentication mechanism
34
- # Configure which keys are used when authenticating a user. The default is
35
- # just :email. You can configure it to use [:username, :subdomain], so for
36
- # authenticating a user, both parameters are required. Remember that those
37
- # parameters are used only when authenticating and not when retrieving from
38
- # session. If you need permissions, you should implement that in a before filter.
39
- # You can also supply a hash where the value is a boolean determining whether
40
- # or not authentication should be aborted when the value is not present.
41
- # config.authentication_keys = [:email]
42
-
43
- # Configure parameters from the request object used for authentication. Each entry
44
- # given should be a request method and it will automatically be passed to the
45
- # find_for_authentication method and considered in your model lookup. For instance,
46
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
47
- # The same considerations mentioned for authentication_keys also apply to request_keys.
48
- # config.request_keys = []
49
-
50
- # Configure which authentication keys should be case-insensitive.
51
- # These keys will be downcased upon creating or modifying a user and when used
52
- # to authenticate or find a user. Default is :email.
53
- config.case_insensitive_keys = [:email]
54
-
55
- # Configure which authentication keys should have whitespace stripped.
56
- # These keys will have whitespace before and after removed upon creating or
57
- # modifying a user and when used to authenticate or find a user. Default is :email.
58
- config.strip_whitespace_keys = [:email]
59
-
60
- # Tell if authentication through request.params is enabled. True by default.
61
- # It can be set to an array that will enable params authentication only for the
62
- # given strategies, for example, `config.params_authenticatable = [:database]` will
63
- # enable it only for database (email + password) authentication.
64
- # config.params_authenticatable = true
65
-
66
- # Tell if authentication through HTTP Auth is enabled. False by default.
67
- # It can be set to an array that will enable http authentication only for the
68
- # given strategies, for example, `config.http_authenticatable = [:database]` will
69
- # enable it only for database authentication. The supported strategies are:
70
- # :database = Support basic authentication with authentication key + password
71
- # config.http_authenticatable = false
72
-
73
- # If 401 status code should be returned for AJAX requests. True by default.
74
- # config.http_authenticatable_on_xhr = true
75
-
76
- # The realm used in Http Basic Authentication. 'Application' by default.
77
- # config.http_authentication_realm = 'Application'
78
-
79
- # It will change confirmation, password recovery and other workflows
80
- # to behave the same regardless if the e-mail provided was right or wrong.
81
- # Does not affect registerable.
82
- # config.paranoid = true
83
-
84
- # By default Devise will store the user in session. You can skip storage for
85
- # particular strategies by setting this option.
86
- # Notice that if you are skipping storage for all authentication paths, you
87
- # may want to disable generating routes to Devise's sessions controller by
88
- # passing skip: :sessions to `devise_for` in your config/routes.rb
89
- config.skip_session_storage = [:http_auth]
90
-
91
- # By default, Devise cleans up the CSRF token on authentication to
92
- # avoid CSRF token fixation attacks. This means that, when using AJAX
93
- # requests for sign in and sign up, you need to get a new CSRF token
94
- # from the server. You can disable this option at your own risk.
95
- # config.clean_up_csrf_token_on_authentication = true
96
-
97
- # When false, Devise will not attempt to reload routes on eager load.
98
- # This can reduce the time taken to boot the app but if your application
99
- # requires the Devise mappings to be loaded during boot time the application
100
- # won't boot properly.
101
- # config.reload_routes = true
102
-
103
- # ==> Configuration for :database_authenticatable
104
- # For bcrypt, this is the cost for hashing the password and defaults to 11. If
105
- # using other algorithms, it sets how many times you want the password to be hashed.
106
- #
107
- # Limiting the stretches to just one in testing will increase the performance of
108
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
109
- # a value less than 10 in other environments. Note that, for bcrypt (the default
110
- # algorithm), the cost increases exponentially with the number of stretches (e.g.
111
- # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
112
- config.stretches = Rails.env.test? ? 1 : 11
113
-
114
- # Set up a pepper to generate the hashed password.
115
- # config.pepper = 'cd724b7dbe7ac7688f5fb620d26b1a305594f4f025e42c279524254dec22e7ff16a501a2d788ffe8d0365b5dc4ea7474c7e694585a8dd132d76887fe1fca7969'
116
-
117
- # Send a notification email when the user's password is changed
118
- # config.send_password_change_notification = false
119
-
120
- # ==> Configuration for :confirmable
121
- # A period that the user is allowed to access the website even without
122
- # confirming their account. For instance, if set to 2.days, the user will be
123
- # able to access the website for two days without confirming their account,
124
- # access will be blocked just in the third day. Default is 0.days, meaning
125
- # the user cannot access the website without confirming their account.
126
- # config.allow_unconfirmed_access_for = 2.days
127
-
128
- # A period that the user is allowed to confirm their account before their
129
- # token becomes invalid. For example, if set to 3.days, the user can confirm
130
- # their account within 3 days after the mail was sent, but on the fourth day
131
- # their account can't be confirmed with the token any more.
132
- # Default is nil, meaning there is no restriction on how long a user can take
133
- # before confirming their account.
134
- # config.confirm_within = 3.days
135
-
136
- # If true, requires any email changes to be confirmed (exactly the same way as
137
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
138
- # db field (see migrations). Until confirmed, new email is stored in
139
- # unconfirmed_email column, and copied to email column on successful confirmation.
140
- config.reconfirmable = false
141
-
142
- # Defines which key will be used when confirming an account
143
- # config.confirmation_keys = [:email]
144
-
145
- # ==> Configuration for :rememberable
146
- # The time the user will be remembered without asking for credentials again.
147
- # config.remember_for = 2.weeks
148
-
149
- # Invalidates all the remember me tokens when the user signs out.
150
- config.expire_all_remember_me_on_sign_out = true
151
-
152
- # If true, extends the user's remember period when remembered via cookie.
153
- # config.extend_remember_period = false
154
-
155
- # Options to be passed to the created cookie. For instance, you can set
156
- # secure: true in order to force SSL only cookies.
157
- # config.rememberable_options = {}
158
-
159
- # ==> Configuration for :validatable
160
- # Range for password length.
161
- config.password_length = 6..128
162
-
163
- # Email regex used to validate email formats. It simply asserts that
164
- # one (and only one) @ exists in the given string. This is mainly
165
- # to give user feedback and not to assert the e-mail validity.
166
- config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
167
-
168
- # ==> Configuration for :timeoutable
169
- # The time you want to timeout the user session without activity. After this
170
- # time the user will be asked for credentials again. Default is 30 minutes.
171
- # config.timeout_in = 30.minutes
172
-
173
- # ==> Configuration for :lockable
174
- # Defines which strategy will be used to lock an account.
175
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
176
- # :none = No lock strategy. You should handle locking by yourself.
177
- # config.lock_strategy = :failed_attempts
178
-
179
- # Defines which key will be used when locking and unlocking an account
180
- # config.unlock_keys = [:email]
181
-
182
- # Defines which strategy will be used to unlock an account.
183
- # :email = Sends an unlock link to the user email
184
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
185
- # :both = Enables both strategies
186
- # :none = No unlock strategy. You should handle unlocking by yourself.
187
- # config.unlock_strategy = :both
188
-
189
- # Number of authentication tries before locking an account if lock_strategy
190
- # is failed attempts.
191
- # config.maximum_attempts = 20
192
-
193
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
194
- # config.unlock_in = 1.hour
195
-
196
- # Warn on the last attempt before the account is locked.
197
- # config.last_attempt_warning = true
198
-
199
- # ==> Configuration for :recoverable
200
- #
201
- # Defines which key will be used when recovering the password for an account
202
- # config.reset_password_keys = [:email]
203
-
204
- # Time interval you can reset your password with a reset password key.
205
- # Don't put a too small interval or your users won't have the time to
206
- # change their passwords.
207
- config.reset_password_within = 6.hours
208
-
209
- # When set to false, does not sign a user in automatically after their password is
210
- # reset. Defaults to true, so a user is signed in automatically after a reset.
211
- # config.sign_in_after_reset_password = true
212
-
213
- # ==> Configuration for :encryptable
214
- # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
215
- # You can use :sha1, :sha512 or algorithms from others authentication tools as
216
- # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
217
- # for default behavior) and :restful_authentication_sha1 (then you should set
218
- # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
219
- #
220
- # Require the `devise-encryptable` gem when using anything other than bcrypt
221
- # config.encryptor = :sha512
222
-
223
- # ==> Scopes configuration
224
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
225
- # "users/sessions/new". It's turned off by default because it's slower if you
226
- # are using only default views.
227
- # config.scoped_views = false
228
-
229
- # Configure the default scope given to Warden. By default it's the first
230
- # devise role declared in your routes (usually :user).
231
- # config.default_scope = :user
232
-
233
- # Set this configuration to false if you want /users/sign_out to sign out
234
- # only the current scope. By default, Devise signs out all scopes.
235
- # config.sign_out_all_scopes = true
236
-
237
- # ==> Navigation configuration
238
- # Lists the formats that should be treated as navigational. Formats like
239
- # :html, should redirect to the sign in page when the user does not have
240
- # access, but formats like :xml or :json, should return 401.
241
- #
242
- # If you have any extra navigational formats, like :iphone or :mobile, you
243
- # should add them to the navigational formats lists.
244
- #
245
- # The "*/*" below is required to match Internet Explorer requests.
246
- # config.navigational_formats = ['*/*', :html]
247
-
248
- # The default HTTP method used to sign out a resource. Default is :delete.
249
- config.sign_out_via = :delete
250
-
251
- # ==> OmniAuth
252
- # Add a new OmniAuth provider. Check the wiki for more information on setting
253
- # up on your models and hooks.
254
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
255
-
256
- # ==> Warden configuration
257
- # If you want to use other strategies, that are not supported by Devise, or
258
- # change the failure app, you can configure them inside the config.warden block.
259
- #
260
- # config.warden do |manager|
261
- # manager.intercept_401 = false
262
- # manager.default_strategies(scope: :user).unshift :some_external_strategy
263
- # end
264
-
265
- # ==> Mountable engine configurations
266
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
267
- # is mountable, there are some extra configurations to be taken into account.
268
- # The following options are available, assuming the engine is mounted as:
269
- #
270
- # mount MyEngine, at: '/my_engine'
271
- #
272
- # The router that invoked `devise_for`, in the example above, would be:
273
- # config.router_name = :my_engine
274
- #
275
- # When using OmniAuth, Devise cannot automatically set OmniAuth path,
276
- # so you need to do it manually. For the users scope, it would be:
277
- # config.omniauth_path_prefix = '/my_engine/users/auth'
278
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- DeviseTokenAuth.setup do |config|
4
- # By default the authorization headers will change after each request. The
5
- # client is responsible for keeping track of the changing tokens. Change
6
- # this to false to prevent the Authorization header from changing after
7
- # each request.
8
- config.change_headers_on_each_request = false
9
-
10
- # By default, users will need to re-authenticate after 2 weeks. This setting
11
- # determines how long tokens will remain valid after they are issued.
12
- config.token_lifespan = 1.hour
13
-
14
- # Limiting the token_cost to just 4 in testing will increase the performance of
15
- # your test suite dramatically. The possible cost value is within range from 4
16
- # to 31. It is recommended to not use a value more than 10 in other environments.
17
- config.token_cost = Rails.env.test? ? 4 : 10
18
-
19
- # Sets the max number of concurrent devices per user, which is 10 by default.
20
- # After this limit is reached, the oldest tokens will be removed.
21
- # config.max_number_of_devices = 10
22
-
23
- # Sometimes it's necessary to make several requests to the API at the same
24
- # time. In this case, each request in the batch will need to share the same
25
- # auth token. This setting determines how far apart the requests can be while
26
- # still using the same auth token.
27
- # config.batch_request_buffer_throttle = 5.seconds
28
-
29
- # This route will be the prefix for all oauth2 redirect callbacks. For
30
- # example, using the default '/omniauth', the github oauth2 provider will
31
- # redirect successful authentications to '/omniauth/github/callback'
32
- # config.omniauth_prefix = "/omniauth"
33
-
34
- # By default sending current password is not needed for the password update.
35
- # Uncomment to enforce current_password param to be checked before all
36
- # attribute updates. Set it to :password if you want it to be checked only if
37
- # password is updated.
38
- # config.check_current_password_before_update = :attributes
39
-
40
- # By default we will use callbacks for single omniauth.
41
- # It depends on fields like email, provider and uid.
42
- # config.default_callbacks = true
43
-
44
- # Makes it possible to change the headers names
45
- # config.headers_names = {:'access-token' => 'access-token',
46
- # :'client' => 'client',
47
- # :'expiry' => 'expiry',
48
- # :'uid' => 'uid',
49
- # :'token-type' => 'token-type' }
50
-
51
- # By default, only Bearer Token authentication is implemented out of the box.
52
- # If, however, you wish to integrate with legacy Devise authentication, you can
53
- # do so by enabling this flag. NOTE: This feature is highly experimental!
54
- # config.enable_standard_devise_support = false
55
- end
@@ -1,4 +0,0 @@
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,16 +0,0 @@
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,4 +0,0 @@
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,9 +0,0 @@
1
- # Creates DATETIME(3) column types by default which support microseconds.
2
- # Without it, only regular (second precise) DATETIME columns are created.
3
- if defined?(ActiveRecord)
4
- module ActiveRecord::ConnectionAdapters
5
- if defined?(AbstractMysqlAdapter)
6
- AbstractMysqlAdapter::NATIVE_DATABASE_TYPES[:datetime][:limit] = 3
7
- end
8
- end
9
- end
@@ -1,3 +0,0 @@
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,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
- end
10
-
11
- # To enable root element in JSON for ActiveRecord objects.
12
- # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
14
- # end
@@ -1,10 +0,0 @@
1
- # Mongoid 9.0+ compatibility
2
- if ENV['AN_ORM'] == 'mongoid'
3
- # Preload helper modules before Rails initialization
4
- Rails.application.config.before_initialize do
5
- # Load all helper files manually to avoid Zeitwerk issues
6
- Dir[Rails.root.join('app', 'helpers', '*.rb')].each do |helper_file|
7
- require_dependency helper_file
8
- end
9
- end
10
- end
@@ -1,26 +0,0 @@
1
- # Additional translations of ActivityNotification
2
-
3
- en:
4
- notification:
5
- user:
6
- article:
7
- create:
8
- text: 'Article has been created'
9
- update:
10
- text: 'Article "%{article_title}" has been updated'
11
- destroy:
12
- text: 'The author removed an article "%{article_title}"'
13
- comment:
14
- create:
15
- text: '%{notifier_name} posted a comment on the article "%{article_title}"'
16
- post:
17
- text:
18
- one: "<p>%{notifier_name} posted a comment on your article %{article_title}</p>"
19
- other: "<p>%{notifier_name} posted %{count} comments on your article %{article_title}</p>"
20
- reply:
21
- text: "<p>%{notifier_name} and %{group_member_count} other people replied %{group_notification_count} times to your comment</p>"
22
- mail_subject: 'New comment on your article'
23
- admin:
24
- article:
25
- post:
26
- text: '[Admin] Article has been created'
@@ -1,62 +0,0 @@
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
- password_change:
27
- subject: "Password Changed"
28
- omniauth_callbacks:
29
- failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
30
- success: "Successfully authenticated from %{kind} account."
31
- passwords:
32
- 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."
33
- send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
34
- 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."
35
- updated: "Your password has been changed successfully. You are now signed in."
36
- updated_not_active: "Your password has been changed successfully."
37
- registrations:
38
- destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
39
- signed_up: "Welcome! You have signed up successfully."
40
- signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
41
- signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
42
- 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."
43
- 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."
44
- updated: "Your account has been updated successfully."
45
- sessions:
46
- signed_in: "Signed in successfully."
47
- signed_out: "Signed out successfully."
48
- already_signed_out: "Signed out successfully."
49
- unlocks:
50
- send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
51
- send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
52
- unlocked: "Your account has been unlocked successfully. Please sign in to continue."
53
- errors:
54
- messages:
55
- already_confirmed: "was already confirmed, please try signing in"
56
- confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
57
- expired: "has expired, please request a new one"
58
- not_found: "not found"
59
- not_locked: "was not locked"
60
- not_saved:
61
- one: "1 error prohibited this %{resource} from being saved:"
62
- other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -1,13 +0,0 @@
1
- development:
2
- clients:
3
- default:
4
- database: activity_notification_development
5
- hosts:
6
- - localhost:27017
7
-
8
- test:
9
- clients:
10
- default:
11
- database: activity_notification_test
12
- hosts:
13
- - localhost:27017
@@ -1,50 +0,0 @@
1
- Rails.application.routes.draw do
2
- # Routes for example Rails application
3
- root to: 'articles#index'
4
- devise_for :users
5
- resources :articles, except: [:destroy]
6
- resources :comments, only: [:create, :destroy]
7
-
8
- # activity_notification routes for users
9
- notify_to :users, with_subscription: true
10
- notify_to :users, with_devise: :users, devise_default_routes: true, with_subscription: true
11
-
12
- # activity_notification routes for admins
13
- notify_to :admins, with_devise: :users, with_subscription: true
14
- scope :admins, as: :admins do
15
- notify_to :admins, with_devise: :users, devise_default_routes: true, with_subscription: true, routing_scope: :admins
16
- end
17
-
18
- # Routes for single page application working with activity_notification REST API backend
19
- resources :spa, only: [:index]
20
- namespace :api do
21
- scope :"v#{ActivityNotification::GEM_VERSION::MAJOR}" do
22
- mount_devise_token_auth_for 'User', at: 'auth'
23
- end
24
- end
25
-
26
- # Routes of activity_notification REST API backend for users
27
- scope :api do
28
- scope :"v#{ActivityNotification::GEM_VERSION::MAJOR}" do
29
- notify_to :users, api_mode: true, with_subscription: true
30
- notify_to :users, api_mode: true, with_devise: :users, devise_default_routes: true, with_subscription: true
31
- resources :apidocs, only: [:index], controller: 'activity_notification/apidocs'
32
- resources :users, only: [:index, :show] do
33
- collection do
34
- get :find
35
- end
36
- end
37
- end
38
- end
39
-
40
- # Routes of activity_notification REST API backend for admins
41
- scope :api do
42
- scope :"v#{ActivityNotification::GEM_VERSION::MAJOR}" do
43
- notify_to :admins, api_mode: true, with_devise: :users, with_subscription: true
44
- scope :admins, as: :admins do
45
- notify_to :admins, api_mode: true, with_devise: :users, devise_default_routes: true, with_subscription: true
46
- end
47
- resources :admins, only: [:index, :show]
48
- end
49
- end
50
- end
@@ -1,22 +0,0 @@
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: cf071f78f72641debc53a32f3076fde13ef7c4502a09c2b2f11b2c541707592e333a1ed21fe4edae9e60f5238c5de18f09767a42c5354cdd00a4083e4a2a5fb0
15
-
16
- test:
17
- secret_key_base: e52716d27db86faf90fbbf4fe4374a8e0bf28ec083aefc1d241ffaa46dee5534ba8fe9482c5be37509766540091dc97a7f054af2920696b27d45bbd0f0d20000
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -1,7 +0,0 @@
1
- const { environment } = require('@rails/webpacker')
2
- const { VueLoaderPlugin } = require('vue-loader')
3
- const vue = require('./loaders/vue')
4
-
5
- environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
6
- environment.loaders.prepend('vue', vue)
7
- module.exports = environment
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- test: /\.vue(\.erb)?$/,
3
- use: [{
4
- loader: 'vue-loader'
5
- }]
6
- }
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'production'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()