activity_notification 1.4.4 → 2.2.4
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.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE/bug_report.md +22 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- data/.github/pull_request_template.md +13 -0
- data/.github/workflows/build.yml +116 -0
- data/.gitignore +15 -3
- data/CHANGELOG.md +200 -1
- data/Gemfile +17 -2
- data/Procfile +2 -0
- data/README.md +168 -1033
- data/Rakefile +19 -10
- data/activity_notification.gemspec +14 -9
- data/app/channels/activity_notification/notification_api_channel.rb +12 -0
- data/app/channels/activity_notification/notification_api_with_devise_channel.rb +46 -0
- data/app/channels/activity_notification/notification_channel.rb +37 -0
- data/app/channels/activity_notification/notification_with_devise_channel.rb +51 -0
- data/app/controllers/activity_notification/apidocs_controller.rb +75 -0
- data/app/controllers/activity_notification/notifications_api_controller.rb +143 -0
- data/app/controllers/activity_notification/notifications_api_with_devise_controller.rb +7 -0
- data/app/controllers/activity_notification/notifications_controller.rb +60 -54
- data/app/controllers/activity_notification/subscriptions_api_controller.rb +197 -0
- data/app/controllers/activity_notification/subscriptions_api_with_devise_controller.rb +7 -0
- data/app/controllers/activity_notification/subscriptions_controller.rb +83 -73
- data/app/jobs/activity_notification/notify_all_job.rb +25 -0
- data/app/jobs/activity_notification/notify_job.rb +26 -0
- data/app/jobs/activity_notification/notify_to_job.rb +25 -0
- data/app/views/activity_notification/notifications/default/_default.html.erb +23 -23
- data/app/views/activity_notification/notifications/default/_default_without_grouping.html.erb +19 -19
- data/app/views/activity_notification/notifications/default/_index.html.erb +3 -3
- data/app/views/activity_notification/notifications/default/index.html.erb +60 -7
- data/app/views/activity_notification/notifications/default/open.js.erb +2 -2
- data/app/views/activity_notification/notifications/default/open_all.js.erb +2 -2
- data/app/views/activity_notification/notifications/default/show.html.erb +2 -2
- data/app/views/activity_notification/optional_targets/default/action_cable_channel/_default.html.erb +176 -0
- data/app/views/activity_notification/optional_targets/default/base/_default.text.erb +1 -1
- data/app/views/activity_notification/optional_targets/default/slack/_default.text.erb +1 -1
- data/app/views/activity_notification/subscriptions/default/_form.html.erb +2 -2
- data/app/views/activity_notification/subscriptions/default/_notification_keys.html.erb +5 -33
- data/app/views/activity_notification/subscriptions/default/_subscription.html.erb +8 -8
- data/app/views/activity_notification/subscriptions/default/index.html.erb +13 -9
- data/app/views/activity_notification/subscriptions/default/show.html.erb +3 -3
- data/app/views/activity_notification/subscriptions/default/subscribe.js.erb +1 -1
- data/app/views/activity_notification/subscriptions/default/subscribe_to_email.js.erb +1 -1
- data/app/views/activity_notification/subscriptions/default/subscribe_to_optional_target.js.erb +1 -1
- data/app/views/activity_notification/subscriptions/default/unsubscribe.js.erb +1 -1
- data/app/views/activity_notification/subscriptions/default/unsubscribe_to_email.js.erb +1 -1
- data/app/views/activity_notification/subscriptions/default/unsubscribe_to_optional_target.js.erb +1 -1
- data/bin/_dynamodblocal +4 -0
- data/bin/bundle_update.sh +7 -0
- data/bin/deploy_on_heroku.sh +16 -0
- data/bin/install_dynamodblocal.sh +5 -0
- data/bin/start_dynamodblocal.sh +47 -0
- data/bin/stop_dynamodblocal.sh +34 -0
- data/docs/CODE_OF_CONDUCT.md +76 -0
- data/docs/CONTRIBUTING.md +36 -0
- data/docs/Functions.md +1146 -0
- data/docs/Setup.md +817 -0
- data/docs/Testing.md +148 -0
- data/gemfiles/Gemfile.rails-5.0 +8 -1
- data/gemfiles/Gemfile.rails-5.1 +7 -1
- data/gemfiles/Gemfile.rails-5.2 +24 -0
- data/gemfiles/Gemfile.rails-6.0 +23 -0
- data/gemfiles/Gemfile.rails-6.1 +22 -0
- data/gemfiles/Gemfile.rails-7.0 +25 -0
- data/lib/activity_notification/apis/notification_api.rb +356 -159
- data/lib/activity_notification/apis/subscription_api.rb +98 -59
- data/lib/activity_notification/apis/swagger.rb +6 -0
- data/lib/activity_notification/common.rb +18 -7
- data/lib/activity_notification/config.rb +176 -30
- data/lib/activity_notification/controllers/common_api_controller.rb +30 -0
- data/lib/activity_notification/controllers/common_controller.rb +47 -27
- data/lib/activity_notification/controllers/concerns/swagger/error_responses.rb +55 -0
- data/lib/activity_notification/controllers/concerns/swagger/notifications_api.rb +273 -0
- data/lib/activity_notification/controllers/concerns/swagger/notifications_parameters.rb +92 -0
- data/lib/activity_notification/controllers/concerns/swagger/subscriptions_api.rb +405 -0
- data/lib/activity_notification/controllers/concerns/swagger/subscriptions_parameters.rb +50 -0
- data/lib/activity_notification/controllers/devise_authentication_controller.rb +22 -5
- data/lib/activity_notification/gem_version.rb +14 -0
- data/lib/activity_notification/helpers/errors.rb +6 -0
- data/lib/activity_notification/helpers/view_helpers.rb +118 -28
- data/lib/activity_notification/mailers/helpers.rb +19 -12
- data/lib/activity_notification/models/concerns/notifiable.rb +142 -55
- data/lib/activity_notification/models/concerns/subscriber.rb +28 -13
- data/lib/activity_notification/models/concerns/swagger/error_schema.rb +36 -0
- data/lib/activity_notification/models/concerns/swagger/notification_schema.rb +209 -0
- data/lib/activity_notification/models/concerns/swagger/subscription_schema.rb +162 -0
- data/lib/activity_notification/models/concerns/target.rb +131 -32
- data/lib/activity_notification/models/notification.rb +1 -0
- data/lib/activity_notification/models/subscription.rb +1 -0
- data/lib/activity_notification/models.rb +23 -1
- data/lib/activity_notification/optional_targets/action_cable_api_channel.rb +69 -0
- data/lib/activity_notification/optional_targets/action_cable_channel.rb +68 -0
- data/lib/activity_notification/optional_targets/base.rb +9 -15
- data/lib/activity_notification/orm/active_record/notification.rb +23 -34
- data/lib/activity_notification/orm/active_record/subscription.rb +1 -1
- data/lib/activity_notification/orm/active_record.rb +1 -1
- data/lib/activity_notification/orm/dynamoid/extension.rb +262 -0
- data/lib/activity_notification/orm/dynamoid/notification.rb +224 -0
- data/lib/activity_notification/orm/dynamoid/subscription.rb +82 -0
- data/lib/activity_notification/orm/dynamoid.rb +530 -0
- data/lib/activity_notification/orm/mongoid/notification.rb +29 -28
- data/lib/activity_notification/orm/mongoid/subscription.rb +3 -3
- data/lib/activity_notification/orm/mongoid.rb +33 -1
- data/lib/activity_notification/rails/routes.rb +273 -60
- data/lib/activity_notification/renderable.rb +22 -7
- data/lib/activity_notification/roles/acts_as_notifiable.rb +64 -1
- data/lib/activity_notification/roles/acts_as_target.rb +99 -9
- data/lib/activity_notification/version.rb +1 -1
- data/lib/activity_notification.rb +14 -0
- data/lib/generators/activity_notification/controllers_generator.rb +2 -1
- data/lib/generators/templates/activity_notification.rb +61 -7
- data/lib/generators/templates/controllers/README +2 -2
- data/lib/generators/templates/controllers/notifications_api_controller.rb +31 -0
- data/lib/generators/templates/controllers/notifications_api_with_devise_controller.rb +31 -0
- data/lib/generators/templates/controllers/notifications_controller.rb +1 -37
- data/lib/generators/templates/controllers/notifications_with_devise_controller.rb +1 -45
- data/lib/generators/templates/controllers/subscriptions_api_controller.rb +61 -0
- data/lib/generators/templates/controllers/subscriptions_api_with_devise_controller.rb +61 -0
- data/lib/generators/templates/controllers/subscriptions_controller.rb +14 -37
- data/lib/generators/templates/controllers/subscriptions_with_devise_controller.rb +14 -45
- data/lib/generators/templates/migrations/migration.rb +5 -5
- data/lib/generators/templates/models/README +8 -4
- data/lib/generators/templates/models/notification.rb +1 -1
- data/lib/generators/templates/models/subscription.rb +1 -1
- data/lib/tasks/activity_notification_tasks.rake +14 -4
- data/package.json +8 -0
- data/spec/channels/notification_api_channel_shared_examples.rb +59 -0
- data/spec/channels/notification_api_channel_spec.rb +49 -0
- data/spec/channels/notification_api_with_devise_channel_spec.rb +76 -0
- data/spec/channels/notification_channel_shared_examples.rb +59 -0
- data/spec/channels/notification_channel_spec.rb +48 -0
- data/spec/channels/notification_with_devise_channel_spec.rb +97 -0
- data/spec/concerns/apis/notification_api_spec.rb +177 -12
- data/spec/concerns/apis/subscription_api_spec.rb +146 -4
- data/spec/concerns/common_spec.rb +25 -3
- data/spec/concerns/models/notifiable_spec.rb +161 -11
- data/spec/concerns/models/subscriber_spec.rb +253 -79
- data/spec/concerns/models/target_spec.rb +180 -47
- data/spec/concerns/renderable_spec.rb +35 -16
- data/spec/config_spec.rb +52 -1
- data/spec/controllers/controller_spec_utility.rb +100 -0
- data/spec/controllers/notifications_api_controller_shared_examples.rb +506 -0
- data/spec/controllers/notifications_api_controller_spec.rb +19 -0
- data/spec/controllers/notifications_api_with_devise_controller_spec.rb +60 -0
- data/spec/controllers/notifications_controller_shared_examples.rb +55 -76
- data/spec/controllers/notifications_controller_spec.rb +1 -2
- data/spec/controllers/notifications_with_devise_controller_spec.rb +14 -8
- data/spec/controllers/subscriptions_api_controller_shared_examples.rb +750 -0
- data/spec/controllers/subscriptions_api_controller_spec.rb +19 -0
- data/spec/controllers/subscriptions_api_with_devise_controller_spec.rb +60 -0
- data/spec/controllers/subscriptions_controller_shared_examples.rb +99 -121
- data/spec/controllers/subscriptions_controller_spec.rb +1 -2
- data/spec/controllers/subscriptions_with_devise_controller_spec.rb +14 -8
- data/spec/factories/notifications.rb +1 -1
- data/spec/factories/subscriptions.rb +3 -3
- data/spec/factories/users.rb +3 -3
- data/spec/generators/migration/migration_generator_spec.rb +29 -4
- data/spec/helpers/view_helpers_spec.rb +31 -21
- data/spec/jobs/notify_all_job_spec.rb +23 -0
- data/spec/jobs/notify_job_spec.rb +23 -0
- data/spec/jobs/notify_to_job_spec.rb +23 -0
- data/spec/mailers/mailer_spec.rb +42 -1
- data/spec/models/dummy/dummy_group_spec.rb +4 -0
- data/spec/models/dummy/dummy_notifiable_spec.rb +4 -0
- data/spec/models/dummy/dummy_notifier_spec.rb +4 -0
- data/spec/models/dummy/dummy_subscriber_spec.rb +3 -0
- data/spec/models/dummy/dummy_target_spec.rb +4 -0
- data/spec/models/notification_spec.rb +181 -45
- data/spec/models/subscription_spec.rb +77 -27
- data/spec/optional_targets/action_cable_api_channel_spec.rb +34 -0
- data/spec/optional_targets/action_cable_channel_spec.rb +41 -0
- data/spec/optional_targets/amazon_sns_spec.rb +0 -2
- data/spec/optional_targets/slack_spec.rb +0 -2
- data/spec/orm/dynamoid_spec.rb +115 -0
- data/spec/rails_app/Rakefile +9 -0
- data/spec/rails_app/app/assets/config/manifest.js +3 -0
- data/spec/rails_app/app/assets/javascripts/application.js +2 -1
- data/spec/rails_app/app/assets/javascripts/cable.js +12 -0
- data/spec/rails_app/app/controllers/admins_controller.rb +21 -0
- data/spec/rails_app/app/controllers/application_controller.rb +1 -1
- data/spec/rails_app/app/controllers/articles_controller.rb +6 -1
- data/spec/rails_app/app/controllers/comments_controller.rb +3 -1
- data/spec/rails_app/app/controllers/spa_controller.rb +7 -0
- data/spec/rails_app/app/controllers/users/notifications_controller.rb +0 -65
- data/spec/rails_app/app/controllers/users/notifications_with_devise_controller.rb +0 -73
- data/spec/rails_app/app/controllers/users/subscriptions_controller.rb +0 -77
- data/spec/rails_app/app/controllers/users/subscriptions_with_devise_controller.rb +0 -85
- data/spec/rails_app/app/controllers/users_controller.rb +26 -0
- data/spec/rails_app/app/javascript/App.vue +40 -0
- data/spec/rails_app/app/javascript/components/DeviseTokenAuth.vue +82 -0
- data/spec/rails_app/app/javascript/components/Top.vue +98 -0
- data/spec/rails_app/app/javascript/components/notifications/Index.vue +200 -0
- data/spec/rails_app/app/javascript/components/notifications/Notification.vue +133 -0
- data/spec/rails_app/app/javascript/components/notifications/NotificationContent.vue +122 -0
- data/spec/rails_app/app/javascript/components/subscriptions/Index.vue +279 -0
- data/spec/rails_app/app/javascript/components/subscriptions/NewSubscription.vue +112 -0
- data/spec/rails_app/app/javascript/components/subscriptions/NotificationKey.vue +141 -0
- data/spec/rails_app/app/javascript/components/subscriptions/Subscription.vue +226 -0
- data/spec/rails_app/app/javascript/config/development.js +5 -0
- data/spec/rails_app/app/javascript/config/environment.js +7 -0
- data/spec/rails_app/app/javascript/config/production.js +5 -0
- data/spec/rails_app/app/javascript/config/test.js +5 -0
- data/spec/rails_app/app/javascript/packs/application.js +18 -0
- data/spec/rails_app/app/javascript/packs/spa.js +14 -0
- data/spec/rails_app/app/javascript/router/index.js +73 -0
- data/spec/rails_app/app/javascript/store/index.js +37 -0
- data/spec/rails_app/app/models/admin.rb +15 -10
- data/spec/rails_app/app/models/article.rb +25 -20
- data/spec/rails_app/app/models/comment.rb +27 -62
- data/spec/rails_app/app/models/dummy/dummy_base.rb +1 -0
- data/spec/rails_app/app/models/dummy/dummy_group.rb +9 -0
- data/spec/rails_app/app/models/dummy/dummy_notifiable.rb +1 -0
- data/spec/rails_app/app/models/dummy/dummy_notifiable_target.rb +27 -0
- data/spec/rails_app/app/models/dummy/dummy_notifier.rb +1 -0
- data/spec/rails_app/app/models/dummy/dummy_subscriber.rb +1 -0
- data/spec/rails_app/app/models/dummy/dummy_target.rb +1 -0
- data/spec/rails_app/app/models/user.rb +44 -18
- data/spec/rails_app/app/views/activity_notification/notifications/default/article/_update.html.erb +146 -0
- data/spec/rails_app/app/views/activity_notification/notifications/users/overridden/custom/_test.html.erb +1 -0
- data/spec/rails_app/app/views/activity_notification/optional_targets/admins/amazon_sns/comment/_default.text.erb +1 -1
- data/spec/rails_app/app/views/articles/index.html.erb +68 -20
- data/spec/rails_app/app/views/articles/show.html.erb +1 -1
- data/spec/rails_app/app/views/layouts/_header.html.erb +9 -3
- data/spec/rails_app/app/views/spa/index.html.erb +2 -0
- data/spec/rails_app/babel.config.js +72 -0
- data/spec/rails_app/bin/webpack +18 -0
- data/spec/rails_app/bin/webpack-dev-server +18 -0
- data/spec/rails_app/config/application.rb +26 -6
- data/spec/rails_app/config/cable.yml +8 -0
- data/spec/rails_app/config/database.yml +1 -1
- data/spec/rails_app/config/dynamoid.rb +13 -0
- data/spec/rails_app/config/environment.rb +5 -1
- data/spec/rails_app/config/environments/development.rb +5 -0
- data/spec/rails_app/config/environments/production.rb +7 -1
- data/spec/rails_app/config/environments/test.rb +7 -11
- data/spec/rails_app/config/initializers/activity_notification.rb +63 -9
- data/spec/rails_app/config/initializers/copy_it.aws.rb.template +6 -0
- data/spec/rails_app/config/initializers/devise_token_auth.rb +55 -0
- data/spec/rails_app/config/initializers/mysql.rb +9 -0
- data/spec/rails_app/config/locales/activity_notification.en.yml +10 -4
- data/spec/rails_app/config/routes.rb +42 -1
- data/spec/rails_app/config/webpack/development.js +5 -0
- data/spec/rails_app/config/webpack/environment.js +7 -0
- data/spec/rails_app/config/webpack/loaders/vue.js +6 -0
- data/spec/rails_app/config/webpack/production.js +5 -0
- data/spec/rails_app/config/webpack/test.js +5 -0
- data/spec/rails_app/config/webpacker.yml +97 -0
- data/spec/rails_app/db/migrate/{20160715050433_create_test_tables.rb → 20160716000000_create_test_tables.rb} +1 -1
- data/spec/rails_app/db/migrate/{20160715050420_create_activity_notification_tables.rb → 20181209000000_create_activity_notification_tables.rb} +3 -3
- data/spec/rails_app/db/migrate/20191201000000_add_tokens_to_users.rb +10 -0
- data/spec/rails_app/db/schema.rb +46 -43
- data/spec/rails_app/db/seeds.rb +28 -4
- data/spec/rails_app/lib/custom_optional_targets/raise_error.rb +14 -0
- data/spec/rails_app/lib/mailer_previews/mailer_preview.rb +14 -4
- data/spec/rails_app/package.json +23 -0
- data/spec/rails_app/postcss.config.js +12 -0
- data/spec/roles/acts_as_group_spec.rb +0 -2
- data/spec/roles/acts_as_notifiable_spec.rb +80 -20
- data/spec/roles/acts_as_notifier_spec.rb +0 -2
- data/spec/roles/acts_as_target_spec.rb +1 -5
- data/spec/spec_helper.rb +13 -11
- data/spec/version_spec.rb +31 -0
- metadata +306 -53
- data/.travis.yml +0 -85
- data/Gemfile.lock +0 -234
- data/gemfiles/Gemfile.rails-4.2 +0 -17
- data/gemfiles/Gemfile.rails-4.2.lock +0 -225
- data/gemfiles/Gemfile.rails-5.0.lock +0 -234
- data/gemfiles/Gemfile.rails-5.1.lock +0 -234
- data/spec/rails_app/app/views/activity_notification/notifications/users/overriden/custom/_test.html.erb +0 -1
- /data/spec/rails_app/app/{models → assets/images}/.keep +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 86e614046f4d79bd83248b78e66855f7fe8269985676b2afd95389b29e56e25f
|
|
4
|
+
data.tar.gz: 7a0e82b085c744a2f3197bd530b69b4ed708d93dcaa6f74ad9854afbf5ecc6a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0dbbb13396e89d5bbfc8f0fc034fb4c1ad1f02e8ceb8ed1e9b6b8beb8c66e55e72c2e23fcd4383564321992f7fd3fe7f7b6dc3c85ddb338ff7cf43639306f15
|
|
7
|
+
data.tar.gz: d972a277eabf7256deff36129a8253a423603333deebd96686d7305a9febcb7b19e85f7ea78b48655326899b06aa1535dc85f01bfb6b340df52a56db583f0336
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
### Steps to reproduce
|
|
11
|
+
<!-- Tell us how to reproduce the issue -->
|
|
12
|
+
|
|
13
|
+
### Expected behavior
|
|
14
|
+
<!-- Tell us what should happen -->
|
|
15
|
+
|
|
16
|
+
### Actual behavior
|
|
17
|
+
<!-- Tell us what happens instead -->
|
|
18
|
+
|
|
19
|
+
### System configuration
|
|
20
|
+
**activity_notification gem version**:
|
|
21
|
+
**Rails version**:
|
|
22
|
+
**ORM (ActiveRecord, Mongoid or Dynamoid)**:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
### Problem or use case
|
|
11
|
+
<!-- Tell us what the problem is if your feature request is related to a problem -->
|
|
12
|
+
|
|
13
|
+
### Expected solution
|
|
14
|
+
<!-- Tell us what you want to happen -->
|
|
15
|
+
|
|
16
|
+
### Alternatives
|
|
17
|
+
<!-- Tell us any alternative solutions or features you've considered -->
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
**Issue #, if available**:
|
|
2
|
+
|
|
3
|
+
### Summary
|
|
4
|
+
|
|
5
|
+
<!-- Provide a general description of the code changes in your pull request.
|
|
6
|
+
Were there any bugs you had fixed? If so, mention them.
|
|
7
|
+
If these bugs have open GitHub issues, be sure to tag them here as well, to keep the conversation linked together. -->
|
|
8
|
+
|
|
9
|
+
### Other Information
|
|
10
|
+
|
|
11
|
+
<!-- If there's anything else that's important and relevant to your pull request, mention that information here.
|
|
12
|
+
|
|
13
|
+
Thank you for contributing to activity_notification! -->
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
name: build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- '**'
|
|
7
|
+
- '!images'
|
|
8
|
+
pull_request:
|
|
9
|
+
branches:
|
|
10
|
+
- '**'
|
|
11
|
+
- '!images'
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
gemfile:
|
|
20
|
+
- gemfiles/Gemfile.rails-5.0
|
|
21
|
+
- gemfiles/Gemfile.rails-5.1
|
|
22
|
+
- gemfiles/Gemfile.rails-5.2
|
|
23
|
+
- gemfiles/Gemfile.rails-6.0
|
|
24
|
+
- gemfiles/Gemfile.rails-6.1
|
|
25
|
+
- gemfiles/Gemfile.rails-7.0
|
|
26
|
+
orm:
|
|
27
|
+
- active_record
|
|
28
|
+
- mongoid
|
|
29
|
+
- dynamoid
|
|
30
|
+
include:
|
|
31
|
+
# https://www.ruby-lang.org/en/downloads
|
|
32
|
+
- gemfile: gemfiles/Gemfile.rails-5.0
|
|
33
|
+
ruby-version: 2.7.7
|
|
34
|
+
- gemfile: gemfiles/Gemfile.rails-5.1
|
|
35
|
+
ruby-version: 2.7.7
|
|
36
|
+
- gemfile: gemfiles/Gemfile.rails-5.2
|
|
37
|
+
ruby-version: 2.7.7
|
|
38
|
+
- gemfile: gemfiles/Gemfile.rails-6.0
|
|
39
|
+
ruby-version: 3.2.1
|
|
40
|
+
- gemfile: gemfiles/Gemfile.rails-6.1
|
|
41
|
+
ruby-version: 3.2.1
|
|
42
|
+
- gemfile: gemfiles/Gemfile.rails-7.0
|
|
43
|
+
ruby-version: 3.2.1
|
|
44
|
+
- gemfile: Gemfile
|
|
45
|
+
ruby-version: 3.2.1
|
|
46
|
+
orm: active_record
|
|
47
|
+
test-db: mysql
|
|
48
|
+
- gemfile: Gemfile
|
|
49
|
+
ruby-version: 3.2.1
|
|
50
|
+
orm: active_record
|
|
51
|
+
test-db: postgresql
|
|
52
|
+
- gemfile: Gemfile
|
|
53
|
+
ruby-version: 3.2.1
|
|
54
|
+
orm: mongoid
|
|
55
|
+
test-db: mongodb
|
|
56
|
+
- gemfile: Gemfile
|
|
57
|
+
ruby-version: head
|
|
58
|
+
orm: active_record
|
|
59
|
+
allow_failures: 'true'
|
|
60
|
+
exclude:
|
|
61
|
+
- gemfile: gemfiles/Gemfile.rails-6.0
|
|
62
|
+
orm: dynamoid
|
|
63
|
+
- gemfile: gemfiles/Gemfile.rails-6.1
|
|
64
|
+
orm: dynamoid
|
|
65
|
+
- gemfile: gemfiles/Gemfile.rails-7.0
|
|
66
|
+
orm: dynamoid
|
|
67
|
+
|
|
68
|
+
env:
|
|
69
|
+
RAILS_ENV: test
|
|
70
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
|
71
|
+
AN_ORM: ${{ matrix.orm }}
|
|
72
|
+
AN_TEST_DB: ${{ matrix.test-db }}
|
|
73
|
+
AWS_DEFAULT_REGION: ap-northeast-1
|
|
74
|
+
AWS_ACCESS_KEY_ID: dummy
|
|
75
|
+
AWS_SECRET_ACCESS_KEY: dummy
|
|
76
|
+
|
|
77
|
+
services:
|
|
78
|
+
mysql:
|
|
79
|
+
image: mysql
|
|
80
|
+
ports:
|
|
81
|
+
- 3306:3306
|
|
82
|
+
env:
|
|
83
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
84
|
+
MYSQL_DATABASE: activity_notification_test
|
|
85
|
+
options: --health-cmd "mysqladmin ping -h 127.0.0.1" --health-interval 10s --health-timeout 5s --health-retries 5
|
|
86
|
+
postgres:
|
|
87
|
+
image: postgres
|
|
88
|
+
ports:
|
|
89
|
+
- 5432:5432
|
|
90
|
+
env:
|
|
91
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
|
92
|
+
POSTGRES_DB: activity_notification_test
|
|
93
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
94
|
+
mongodb:
|
|
95
|
+
image: mongo
|
|
96
|
+
ports:
|
|
97
|
+
- 27017:27017
|
|
98
|
+
env:
|
|
99
|
+
MONGO_INITDB_DATABASE: activity_notification_test
|
|
100
|
+
options: --health-cmd mongosh --health-interval 10s --health-timeout 5s --health-retries 5
|
|
101
|
+
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v2
|
|
104
|
+
- name: Set up Ruby
|
|
105
|
+
uses: ruby/setup-ruby@v1
|
|
106
|
+
with:
|
|
107
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
108
|
+
bundler-cache: true
|
|
109
|
+
- name: Setup Amazon DynamoDB Local
|
|
110
|
+
if: matrix.orm == 'dynamoid'
|
|
111
|
+
run: |
|
|
112
|
+
bin/install_dynamodblocal.sh
|
|
113
|
+
bin/start_dynamodblocal.sh
|
|
114
|
+
- name: Run tests with RSpec
|
|
115
|
+
run: bundle exec rspec
|
|
116
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
data/.gitignore
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
*.rbc
|
|
3
3
|
/.config
|
|
4
4
|
/coverage/
|
|
5
|
+
/Gemfile.lock
|
|
6
|
+
/gemfiles/Gemfile*.lock
|
|
5
7
|
/InstalledFiles
|
|
6
8
|
/pkg/
|
|
7
9
|
/spec/reports/
|
|
10
|
+
/spec/openapi.json
|
|
8
11
|
/spec/examples.txt
|
|
9
12
|
/spec/rails_app/log/*
|
|
10
13
|
/spec/rails_app/tmp/*
|
|
14
|
+
/spec/rails_app/public/assets/
|
|
15
|
+
/spec/DynamoDBLocal-latest/
|
|
11
16
|
/test/tmp/
|
|
12
17
|
/test/version_tmp/
|
|
13
18
|
/tmp/
|
|
@@ -15,6 +20,7 @@
|
|
|
15
20
|
*~
|
|
16
21
|
*.sqlite3
|
|
17
22
|
.project
|
|
23
|
+
.DS_Store
|
|
18
24
|
|
|
19
25
|
# Used by dotenv library to load environment variables.
|
|
20
26
|
# .env
|
|
@@ -49,11 +55,17 @@ build-iPhoneSimulator/
|
|
|
49
55
|
/gemfiles/vendor/bundle
|
|
50
56
|
/lib/bundler/man/
|
|
51
57
|
|
|
58
|
+
# Ignore webpacker files
|
|
59
|
+
/spec/rails_app/node_modules
|
|
60
|
+
/spec/rails_app/yarn.lock
|
|
61
|
+
/spec/rails_app/yarn-error.log
|
|
62
|
+
/spec/rails_app/public/packs
|
|
63
|
+
/spec/rails_app/public/packs-test
|
|
64
|
+
|
|
52
65
|
# for a library or gem, you might want to ignore these files since the code is
|
|
53
66
|
# intended to run in multiple environments; otherwise, check them in:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# .ruby-gemset
|
|
67
|
+
.ruby-version
|
|
68
|
+
.ruby-gemset
|
|
57
69
|
|
|
58
70
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
59
71
|
.rvmrc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,202 @@
|
|
|
1
|
+
## 2.2.4 / 2023-03-20
|
|
2
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.2.3...v2.2.4)
|
|
3
|
+
|
|
4
|
+
Bug Fixes:
|
|
5
|
+
|
|
6
|
+
* Fix broken serialization with Rails security patch - [#166](https://github.com/simukappu/activity_notification/issues/166) [#167](https://github.com/simukappu/activity_notification/pull/167)
|
|
7
|
+
|
|
8
|
+
## 2.2.3 / 2022-02-12
|
|
9
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.2.2...v2.2.3)
|
|
10
|
+
|
|
11
|
+
Enhancements:
|
|
12
|
+
|
|
13
|
+
* Allow use with Rails 7.0 - [#164](https://github.com/simukappu/activity_notification/issues/164) [#165](https://github.com/simukappu/activity_notification/pull/165)
|
|
14
|
+
* Add *rescue_optional_target_errors* config option to capture errors on optional targets - [#155](https://github.com/simukappu/activity_notification/issues/155) [#156](https://github.com/simukappu/activity_notification/pull/156)
|
|
15
|
+
* Remove type definition from several columns with nullable and multiple type in OpenAPI schema
|
|
16
|
+
|
|
17
|
+
## 2.2.2 / 2021-04-18
|
|
18
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.2.1...v2.2.2)
|
|
19
|
+
|
|
20
|
+
Enhancements:
|
|
21
|
+
|
|
22
|
+
* Configure default subscriptions for emails and optional targets - [#159](https://github.com/simukappu/activity_notification/issues/159) [#160](https://github.com/simukappu/activity_notification/pull/160)
|
|
23
|
+
* Upgrade gem dependency in tests with Rails 6.1 - [#152](https://github.com/simukappu/activity_notification/issues/152)
|
|
24
|
+
|
|
25
|
+
## 2.2.1 / 2021-01-24
|
|
26
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.2.0...v2.2.1)
|
|
27
|
+
|
|
28
|
+
Enhancements:
|
|
29
|
+
|
|
30
|
+
* Allow use with Rails 6.1 - [#152](https://github.com/simukappu/activity_notification/issues/152)
|
|
31
|
+
|
|
32
|
+
## 2.2.0 / 2020-12-05
|
|
33
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.4...v2.2.0)
|
|
34
|
+
|
|
35
|
+
Enhancements:
|
|
36
|
+
|
|
37
|
+
* Remove support for Rails 4.2 - [#151](https://github.com/simukappu/activity_notification/issues/151)
|
|
38
|
+
* Turn on deprecation warnings in RSpec testing for Ruby 2.7 - [#122](https://github.com/simukappu/activity_notification/issues/122)
|
|
39
|
+
* Remove Ruby 2.7 deprecation warnings - [#122](https://github.com/simukappu/activity_notification/issues/122)
|
|
40
|
+
|
|
41
|
+
Breaking Changes:
|
|
42
|
+
|
|
43
|
+
* Specify DynamoDB global secondary index name
|
|
44
|
+
* Update additional fields to store into DynamoDB when *config.store_with_associated_records* is true
|
|
45
|
+
|
|
46
|
+
## 2.1.4 / 2020-11-07
|
|
47
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.3...v2.1.4)
|
|
48
|
+
|
|
49
|
+
Enhancements:
|
|
50
|
+
|
|
51
|
+
* Make *Common#to_class_name* method return base_class name in order to work with STI models - [#89](https://github.com/simukappu/activity_notification/issues/89) [#139](https://github.com/simukappu/activity_notification/pull/139)
|
|
52
|
+
|
|
53
|
+
Bug Fixes:
|
|
54
|
+
|
|
55
|
+
* Rename *Notifiable#notification_action_cable_allowed?* to *notifiable_action_cable_allowed?* to fix duplicate method name error - [#138](https://github.com/simukappu/activity_notification/issues/138)
|
|
56
|
+
* Fix hash syntax in swagger schemas - [#146](https://github.com/simukappu/activity_notification/issues/146) [#147](https://github.com/simukappu/activity_notification/pull/147)
|
|
57
|
+
|
|
58
|
+
## 2.1.3 / 2020-08-11
|
|
59
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.2...v2.1.3)
|
|
60
|
+
|
|
61
|
+
Enhancements:
|
|
62
|
+
|
|
63
|
+
* Enable to use namespaced model - [#132](https://github.com/simukappu/activity_notification/pull/132)
|
|
64
|
+
|
|
65
|
+
Bug Fixes:
|
|
66
|
+
|
|
67
|
+
* Fix mongoid any_of selector error in filtered_by_group scope - [MONGOID-4887](https://jira.mongodb.org/browse/MONGOID-4887)
|
|
68
|
+
|
|
69
|
+
## 2.1.2 / 2020-02-24
|
|
70
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.1...v2.1.2)
|
|
71
|
+
|
|
72
|
+
Bug Fixes:
|
|
73
|
+
|
|
74
|
+
* Fix scope of uniqueness validation in subscription model with mongoid - [#126](https://github.com/simukappu/activity_notification/issues/126) [#128](https://github.com/simukappu/activity_notification/pull/128)
|
|
75
|
+
* Fix uninitialized constant DeviseTokenAuth when *config.eager_load = true* - [#129](https://github.com/simukappu/activity_notification/issues/129)
|
|
76
|
+
|
|
77
|
+
## 2.1.1 / 2020-02-11
|
|
78
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.0...v2.1.1)
|
|
79
|
+
|
|
80
|
+
Bug Fixes:
|
|
81
|
+
|
|
82
|
+
* Fix eager_load by autoloading VERSION - [#124](https://github.com/simukappu/activity_notification/issues/124) [#125](https://github.com/simukappu/activity_notification/pull/125)
|
|
83
|
+
|
|
84
|
+
## 2.1.0 / 2020-02-04
|
|
85
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.0.0...v2.1.0)
|
|
86
|
+
|
|
87
|
+
Enhancements:
|
|
88
|
+
|
|
89
|
+
* Add API mode using notification and subscription API controllers - [#108](https://github.com/simukappu/activity_notification/issues/108) [#113](https://github.com/simukappu/activity_notification/issues/113)
|
|
90
|
+
* Add API controllers integrated with Devise Token Auth - [#108](https://github.com/simukappu/activity_notification/issues/108) [#113](https://github.com/simukappu/activity_notification/issues/113)
|
|
91
|
+
* Add sample single page application working with REST API backend - [#108](https://github.com/simukappu/activity_notification/issues/108) [#113](https://github.com/simukappu/activity_notification/issues/113)
|
|
92
|
+
* Move Action Cable broadcasting to optional targets - [#111](https://github.com/simukappu/activity_notification/issues/111)
|
|
93
|
+
* Add Action Cable API channels publishing formatted JSON - [#111](https://github.com/simukappu/activity_notification/issues/111)
|
|
94
|
+
* Rescue and skip error in optional_targets - [#103](https://github.com/simukappu/activity_notification/issues/103)
|
|
95
|
+
* Add *later_than* and *earlier_than* filter options to notification index API - [#108](https://github.com/simukappu/activity_notification/issues/108)
|
|
96
|
+
* Add key uniqueness validation to subscription model - [#119](https://github.com/simukappu/activity_notification/issues/119)
|
|
97
|
+
* Make mailer headers more configurable to set custom *from*, *reply_to* and *message_id* - [#116](https://github.com/simukappu/activity_notification/pull/116)
|
|
98
|
+
* Allow use and test with Rails 6.0 release - [#102](https://github.com/simukappu/activity_notification/issues/102)
|
|
99
|
+
|
|
100
|
+
Breaking Changes:
|
|
101
|
+
|
|
102
|
+
* Change HTTP POST method of open notification and subscription methods into PUT method
|
|
103
|
+
* Make *Target#open_all_notifications* return opened notification records instead of their count
|
|
104
|
+
* Make *Subscriber#create_subscription* raise *ActivityNotification::RecordInvalidError* when the request is invalid - [#119](https://github.com/simukappu/activity_notification/pull/119)
|
|
105
|
+
|
|
106
|
+
## 2.0.0 / 2019-08-09
|
|
107
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.7.1...v2.0.0)
|
|
108
|
+
|
|
109
|
+
Enhancements:
|
|
110
|
+
|
|
111
|
+
* Add push notification with Action Cable - [#101](https://github.com/simukappu/activity_notification/issues/101)
|
|
112
|
+
* Allow use with Rails 6.0 - [#102](https://github.com/simukappu/activity_notification/issues/102)
|
|
113
|
+
* Add Amazon DynamoDB support using Dynamoid
|
|
114
|
+
* Add *ActivityNotification.config.store_with_associated_records* option
|
|
115
|
+
* Add test case using Mongoid orm with ActiveRecord application
|
|
116
|
+
* Publish demo application on Heroku
|
|
117
|
+
|
|
118
|
+
Bug Fixes:
|
|
119
|
+
|
|
120
|
+
* Fix syntax error of a default view *_default_without_grouping.html.erb*
|
|
121
|
+
|
|
122
|
+
Deprecated:
|
|
123
|
+
|
|
124
|
+
* Remove deprecated *ActivityNotification.config.table_name* option
|
|
125
|
+
|
|
126
|
+
## 1.7.1 / 2019-04-30
|
|
127
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.7.0...v1.7.1)
|
|
128
|
+
|
|
129
|
+
Enhancements:
|
|
130
|
+
|
|
131
|
+
* Use after_commit for tracked callbacks instead of after_create and after_update - [#99](https://github.com/simukappu/activity_notification/issues/99)
|
|
132
|
+
|
|
133
|
+
## 1.7.0 / 2018-12-09
|
|
134
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.6.1...v1.7.0)
|
|
135
|
+
|
|
136
|
+
Enhancements:
|
|
137
|
+
|
|
138
|
+
* Support asynchronous notification API - [#29](https://github.com/simukappu/activity_notification/issues/29)
|
|
139
|
+
|
|
140
|
+
Bug Fixes:
|
|
141
|
+
|
|
142
|
+
* Fix migration generator to specify the Rails release in generated migration files for Rails 5.x - [#96](https://github.com/simukappu/activity_notification/issues/96)
|
|
143
|
+
|
|
144
|
+
Breaking Changes:
|
|
145
|
+
|
|
146
|
+
* Change method name of *Target#notify_to* into *Target#receive_notification_of* to avoid ambiguous method name with *Notifiable#notify_to* - [#88](https://github.com/simukappu/activity_notification/issues/88)
|
|
147
|
+
|
|
148
|
+
## 1.6.1 / 2018-11-19
|
|
149
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.6.0...v1.6.1)
|
|
150
|
+
|
|
151
|
+
Enhancements:
|
|
152
|
+
|
|
153
|
+
* Update README.md to describe how to customize email subject - [#93](https://github.com/simukappu/activity_notification/issues/93)
|
|
154
|
+
|
|
155
|
+
Bug Fixes:
|
|
156
|
+
|
|
157
|
+
* Fix *notify_all* method to handle single notifiable target models - [#88](https://github.com/simukappu/activity_notification/issues/88)
|
|
158
|
+
|
|
159
|
+
## 1.6.0 / 2018-11-11
|
|
160
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.5.1...v1.6.0)
|
|
161
|
+
|
|
162
|
+
Enhancements:
|
|
163
|
+
|
|
164
|
+
* Add simple default routes with devise integration - [#64](https://github.com/simukappu/activity_notification/issues/64)
|
|
165
|
+
* Add *:routing_scope* option to support routes with scope - [#56](https://github.com/simukappu/activity_notification/issues/56)
|
|
166
|
+
|
|
167
|
+
Bug Fixes:
|
|
168
|
+
|
|
169
|
+
* Update *Subscription.optional_targets* into HashWithIndifferentAccess to fix subscriptions with mongoid
|
|
170
|
+
|
|
171
|
+
## 1.5.1 / 2018-08-26
|
|
172
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.5.0...v1.5.1)
|
|
173
|
+
|
|
174
|
+
Enhancements:
|
|
175
|
+
|
|
176
|
+
* Allow configuration of custom mailer templates directory - [#32](https://github.com/simukappu/activity_notification/pull/32)
|
|
177
|
+
* Make Notifiable#notifiable_path to work when it is defined in a superclass - [#45](https://github.com/simukappu/activity_notification/pull/45)
|
|
178
|
+
|
|
179
|
+
Bug Fixes:
|
|
180
|
+
|
|
181
|
+
* Fix mongoid development dependency to work with bullet - [#72](https://github.com/simukappu/activity_notification/issues/72)
|
|
182
|
+
* Remove duplicate scope of filtered_by_type since it is also defined in API - [#78](https://github.com/simukappu/activity_notification/pull/78)
|
|
183
|
+
* Fix a bug in Subscriber concern about lack of arguments - [#80](https://github.com/simukappu/activity_notification/issues/80)
|
|
184
|
+
|
|
185
|
+
## 1.5.0 / 2018-05-05
|
|
186
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.4.4...v1.5.0)
|
|
187
|
+
|
|
188
|
+
Enhancements:
|
|
189
|
+
|
|
190
|
+
* Allow use with Rails 5.2
|
|
191
|
+
* Enhancements for using the gem with i18n
|
|
192
|
+
* Symbolize parameters for i18n interpolation
|
|
193
|
+
* Allow pluralization in i18n translation
|
|
194
|
+
* Update render method to use plain
|
|
195
|
+
|
|
196
|
+
Bug Fixes:
|
|
197
|
+
|
|
198
|
+
* Fix a doc bug for controllers template
|
|
199
|
+
|
|
1
200
|
## 1.4.4 / 2017-11-18
|
|
2
201
|
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.4.3...v1.4.4)
|
|
3
202
|
|
|
@@ -110,7 +309,7 @@ Bug Fixes:
|
|
|
110
309
|
|
|
111
310
|
Breaking Changes:
|
|
112
311
|
|
|
113
|
-
* Remove *notifiable_type* from the argument of
|
|
312
|
+
* Remove *notifiable_type* from the argument of overridden method or configured lambda function with *:batch_email_allowed* option in *acts_as_target* role
|
|
114
313
|
|
|
115
314
|
## 1.0.2 / 2016-11-14
|
|
116
315
|
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.0.1...v1.0.2)
|
data/Gemfile
CHANGED
|
@@ -2,7 +2,17 @@ source 'https://rubygems.org'
|
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
-
gem 'rails', '~>
|
|
5
|
+
gem 'rails', '~> 7.0.0'
|
|
6
|
+
|
|
7
|
+
group :production do
|
|
8
|
+
gem 'sprockets-rails'
|
|
9
|
+
gem 'puma'
|
|
10
|
+
gem 'pg'
|
|
11
|
+
gem 'devise'
|
|
12
|
+
# gem 'devise_token_auth'
|
|
13
|
+
# https://github.com/lynndylanhurley/devise_token_auth/pull/1517
|
|
14
|
+
gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth.git'
|
|
15
|
+
end
|
|
6
16
|
|
|
7
17
|
group :development do
|
|
8
18
|
gem 'bullet'
|
|
@@ -12,7 +22,12 @@ group :test do
|
|
|
12
22
|
gem 'rails-controller-testing'
|
|
13
23
|
gem 'ammeter'
|
|
14
24
|
gem 'timecop'
|
|
15
|
-
gem '
|
|
25
|
+
gem 'committee'
|
|
26
|
+
gem 'committee-rails', '< 0.6'
|
|
27
|
+
# gem 'coveralls', require: false
|
|
28
|
+
gem 'coveralls_reborn', require: false
|
|
16
29
|
end
|
|
17
30
|
|
|
31
|
+
gem 'webpacker', groups: [:production, :development]
|
|
32
|
+
gem 'rack-cors', groups: [:production, :development]
|
|
18
33
|
gem 'dotenv-rails', groups: [:development, :test]
|
data/Procfile
ADDED