activity_notification 2.4.0 → 2.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f81f1308188c8ac3e07332a40b1fab62c5af3a43dbbe135a71303e31d403285
4
- data.tar.gz: db55d9f9811dcceecd1f562feaf33949faf716ce6ab07e45f0f35b077b032923
3
+ metadata.gz: d670191ff319b7ca33142f0f92cdd3d0332287082d4512515175492431a14b2d
4
+ data.tar.gz: da39c715f28ae37adc1da46ca3b148b7664627f9e0a9bd924200707340599b18
5
5
  SHA512:
6
- metadata.gz: b4287ae97e4d9f3f3788a5d0fc36b9eb9837880d1ed4289a2e881d32e8a61baecfcd9dc1f9f8e0846214a87fdd4a808e042a3ae77a283a2eb5d4d4bffa4f6411
7
- data.tar.gz: 2be55085563ca99a32c029bcc5ecf5e3a025d42a72326ef0f40f218f123af478d2adf760bf5cb51a142a6e326d0bf6c33374c9116e2cd39f0d1b248d3e69b5bd
6
+ metadata.gz: 82104cb3b70c4530714d56a91bec204bc7ffc5c4a0f93c6646f483b7eff888b5906c20613410df2df423c155eb8a18771538e30b07c59e07d525dda35afbf9a7
7
+ data.tar.gz: c0c9027327dbd0667bced6899cb619a4463bef3ff131c8818d3388ea6e5abeeffa51ce63990f6770210d98d06c504972cc33996593f58f14dce4de4089d95632
@@ -95,7 +95,6 @@ jobs:
95
95
  bin/install_dynamodblocal.sh
96
96
  bin/start_dynamodblocal.sh
97
97
  - name: Run tests with RSpec
98
- run: bundle exec rspec
99
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
98
+ run: bundle exec rspec --format progress
100
99
  - name: Coveralls
101
100
  uses: coverallsapp/github-action@v2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 2.4.1 / 2025-12-31
2
+ [Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.4.0...v2.4.1)
3
+
4
+ Enhancements:
5
+
6
+ * Make Mongoid and Dynamoid optional dependencies - [#190](https://github.com/simukappu/activity_notification/issues/190)
7
+
8
+ Bug Fixes:
9
+
10
+ * Fix OpenAPI schema validation errors in Subscription model
11
+ * Fix Dynamoid ORM datetime format issue in optional_targets API response
12
+ * Fix OpenAPI parser deprecation warning by adding strict_reference_validation configuration
13
+
1
14
  ## 2.4.0 / 2025-08-20
2
15
  [Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.3.3...v2.4.0)
3
16
 
data/README.md CHANGED
@@ -31,22 +31,6 @@
31
31
  * Activity notifications stream integrated into cloud computing using [Amazon DynamoDB Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)
32
32
  * Optional notification targets (Configurable optional notification targets like [Amazon SNS](https://aws.amazon.com/sns), [Slack](https://slack.com), SMS and so on)
33
33
 
34
- ### Online Demo
35
-
36
- You can see an actual application using this gem here:
37
- * **https://activity-notification-example.herokuapp.com/**
38
-
39
- Login as the following test users to experience user activity notifications:
40
-
41
- | Email | Password | Admin? |
42
- |:---:|:---:|:---:|
43
- | ichiro@example.com | changeit | Yes |
44
- | stephen@example.com | changeit | |
45
- | klay@example.com | changeit | |
46
- | kevin@example.com | changeit | |
47
-
48
- The deployed demo application is included in this gem's source code as a test application here: *[/spec/rails_app](/spec/rails_app/)*
49
-
50
34
  ### Notification index and plugin notifications
51
35
 
52
36
  <kbd>![plugin-notifications-image](https://raw.githubusercontent.com/simukappu/activity_notification/images/activity_notification_plugin_focus_with_subscription.png)</kbd>
@@ -70,16 +54,12 @@ The deployed demo application is included in this gem's source code as a test ap
70
54
  REST API reference as OpenAPI Specification is published in SwaggerHub here:
71
55
  * **https://app.swaggerhub.com/apis-docs/simukappu/activity-notification/**
72
56
 
73
- You can see sample single page application using [Vue.js](https://vuejs.org) as a part of example Rails application here:
74
- * **https://activity-notification-example.herokuapp.com/spa/**
75
-
76
- This sample application works with *activity_notification* REST API backend.
57
+ You can see sample single page application using [Vue.js](https://vuejs.org) as a part of example Rails application in *[/spec/rails_app](/spec/rails_app/)*. This sample application works with *activity_notification* REST API backend.
77
58
 
78
59
 
79
60
  ## Table of Contents
80
61
 
81
62
  - [About](#about)
82
- - [Online Demo](#online-demo)
83
63
  - [Public REST API reference as OpenAPI Specification](#public-rest-apu-reference-as-openapi-specification)
84
64
  - [Getting Started](#getting-started)
85
65
  - [Setup](/docs/Setup.md#Setup)
@@ -155,6 +135,7 @@ This sample application works with *activity_notification* REST API backend.
155
135
  - [Testing gem alone](/docs/Testing.md#testing-gem-alone)
156
136
  - [Documentation](#documentation)
157
137
  - [Common Examples](#common-examples)
138
+ - [Example Rails application](/docs/Testing.md#example-rails-application)
158
139
  - [Contributing](#contributing)
159
140
  - [License](#license)
160
141
 
@@ -184,6 +165,24 @@ $ bin/rails generate activity_notification:install
184
165
 
185
166
  The generator will install an initializer which describes all configuration options of *activity_notification*.
186
167
 
168
+ #### ORM Dependencies
169
+
170
+ By default, *activity_notification* uses **ActiveRecord** as the ORM and no additional ORM gems are required.
171
+
172
+ If you intend to use **Mongoid** support, you need to add the `mongoid` gem separately to your Gemfile:
173
+
174
+ ```ruby
175
+ gem 'activity_notification'
176
+ gem 'mongoid', '>= 4.0.0', '< 10.0'
177
+ ```
178
+
179
+ If you intend to use **Dynamoid** support for Amazon DynamoDB, you need to add the `dynamoid` gem separately to your Gemfile:
180
+
181
+ ```ruby
182
+ gem 'activity_notification'
183
+ gem 'dynamoid', '>= 3.11.0', '< 4.0'
184
+ ```
185
+
187
186
  ### Database setup
188
187
 
189
188
  When you use *activity_notification* with ActiveRecord ORM as default configuration,
@@ -342,12 +341,7 @@ Then you can see the documents at <http://localhost:8808/docs/index>.
342
341
 
343
342
  ## Common Examples
344
343
 
345
- See example Rails application in *[/spec/rails_app](/spec/rails_app)*.
346
-
347
- You can also try this example Rails application as Online Demo here:
348
- * **https://activity-notification-example.herokuapp.com/**
349
-
350
- You can login as test users to experience user activity notifications. For more details, see [Online Demo](#online-demo).
344
+ See example Rails application in *[/spec/rails_app](/spec/rails_app)*. You can login as test users to experience user activity notifications. For more details, see [Example Rails application](/docs/Testing.md#example-rails-application).
351
345
 
352
346
 
353
347
  ## Contributing
@@ -21,8 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.required_ruby_version = '>= 2.1.0'
22
22
 
23
23
  s.add_dependency 'railties', '>= 7.0.0', '< 8.1'
24
- s.add_dependency 'mongoid', '>= 4.0.0', '< 10.0'
25
- s.add_dependency 'dynamoid', '>= 3.11.0', '< 4.0'
26
24
  s.add_dependency 'i18n', '>= 0.5.0'
27
25
  s.add_dependency 'jquery-rails', '>= 3.1.1'
28
26
  s.add_dependency 'swagger-blocks', '>= 3.0.0'
@@ -31,6 +29,8 @@ Gem::Specification.new do |s|
31
29
  s.add_development_dependency 'sqlite3', '>= 1.3.13'
32
30
  s.add_development_dependency 'mysql2', '>= 0.5.2'
33
31
  s.add_development_dependency 'pg', '>= 1.0.0'
32
+ s.add_development_dependency 'mongoid', '>= 4.0.0', '< 10.0'
33
+ s.add_development_dependency 'dynamoid', '>= 3.11.0', '< 4.0'
34
34
  s.add_development_dependency 'rspec-rails', '>= 3.8.0'
35
35
  s.add_development_dependency 'factory_bot_rails', '>= 4.11.0'
36
36
  s.add_development_dependency 'simplecov', '~> 0'
data/docs/Functions.md CHANGED
@@ -381,8 +381,6 @@ end
381
381
 
382
382
  Then, you can access *users/1/subscriptions* and use *[ActivityNotification::SubscriptionsController](/app/controllers/activity_notification/subscriptions_controller.rb)* or *[ActivityNotification::SubscriptionsWithDeviseController](/app/controllers/activity_notification/subscriptions_with_devise_controller.rb)* to manage the subscriptions.
383
383
 
384
- You can see sample subscription management view in demo application here: *https://activity-notification-example.herokuapp.com/users/1/subscriptions*
385
-
386
384
  If you would like to customize subscription controllers or views, you can use generators like notifications:
387
385
 
388
386
  * Customize subscription controllers
@@ -436,8 +434,6 @@ You can see [sample single page application](/spec/rails_app/app/javascript/) us
436
434
 
437
435
  *activity_notification* provides API reference as [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification).
438
436
 
439
- OpenAPI Specification in [online demo](https://activity-notification-example.herokuapp.com/) is published here: **https://activity-notification-example.herokuapp.com/api/v2/apidocs**
440
-
441
437
  Public API reference is also hosted in [SwaggerHub](https://swagger.io/tools/swaggerhub/) here: **https://app.swaggerhub.com/apis-docs/simukappu/activity-notification/**
442
438
 
443
439
  You can also publish OpenAPI Specification in your own application using *[ActivityNotification::ApidocsController](/app/controllers/activity_notification/apidocs_controller.rb)* like this:
@@ -588,7 +584,7 @@ end
588
584
  To sign in and get *access-token* from Devise Token Auth, call *sign_in* API which you configured by *mount_devise_token_auth_for* method:
589
585
 
590
586
  ```console
591
- $ curl -X POST -H "Content-Type: application/json" -D - -d '{"email": "ichiro@example.com","password": "changeit"}' https://activity-notification-example.herokuapp.com/api/v2/auth/sign_in
587
+ $ curl -X POST -H "Content-Type: application/json" -D - -d '{"email": "ichiro@example.com","password": "changeit"}' https://localhost:3000/api/v2/auth/sign_in
592
588
 
593
589
 
594
590
  HTTP/1.1 200 OK
@@ -615,7 +611,7 @@ uid: ichiro@example.com
615
611
  Then, call *activity_notification* API with returned *access-token*, *client* and *uid* as HTTP headers:
616
612
 
617
613
  ```console
618
- $ curl -X GET -H "Content-Type: application/json" -H "access-token: ZiDvw8vJGtbESy5Qpw32Kw" -H "client: W0NkGrTS88xeOx4VDOS-Xg" -H "uid: ichiro@example.com" -D - https://activity-notification-example.herokuapp.com/api/v2/notifications
614
+ $ curl -X GET -H "Content-Type: application/json" -H "access-token: ZiDvw8vJGtbESy5Qpw32Kw" -H "client: W0NkGrTS88xeOx4VDOS-Xg" -H "uid: ichiro@example.com" -D - https://localhost:3000/api/v2/notifications
619
615
 
620
616
  HTTP/1.1 200 OK
621
617
  ...
@@ -631,7 +627,7 @@ HTTP/1.1 200 OK
631
627
  Without valid *access-token*, API returns *401 Unauthorized*:
632
628
 
633
629
  ```console
634
- $ curl -X GET -H "Content-Type: application/json" -D - https://activity-notification-example.herokuapp.com/api/v2/notifications
630
+ $ curl -X GET -H "Content-Type: application/json" -D - https://localhost:3000/api/v2/notifications
635
631
 
636
632
  HTTP/1.1 401 Unauthorized
637
633
  ...
@@ -646,7 +642,7 @@ HTTP/1.1 401 Unauthorized
646
642
  When you request restricted resources of unauthorized targets, *activity_notification* API returns *403 Forbidden*:
647
643
 
648
644
  ```console
649
- $ curl -X GET -H "Content-Type: application/json" -H "access-token: ZiDvw8vJGtbESy5Qpw32Kw" -H "client: W0NkGrTS88xeOx4VDOS-Xg" -H "uid: ichiro@example.com" -D - https://activity-notification-example.herokuapp.com/api/v2/notifications/1
645
+ $ curl -X GET -H "Content-Type: application/json" -H "access-token: ZiDvw8vJGtbESy5Qpw32Kw" -H "client: W0NkGrTS88xeOx4VDOS-Xg" -H "uid: ichiro@example.com" -D - https://localhost:3000/api/v2/notifications/1
650
646
 
651
647
  HTTP/1.1 403 Forbidden
652
648
  ...
@@ -1141,6 +1137,4 @@ user.find_or_create_subscription('comment.reply').subscribe_to_optional_target(:
1141
1137
  user.find_or_create_subscription('comment.reply').unsubscribe_to_optional_target(:slack)
1142
1138
  ```
1143
1139
 
1144
- You can also manage subscriptions of optional targets by subscriptions REST API. See [REST API backend](#rest-api-backend) for more details.
1145
-
1146
- You can see sample subscription management view in demo application here: *https://activity-notification-example.herokuapp.com/users/1/subscriptions*
1140
+ You can also manage subscriptions of optional targets by subscriptions REST API. See [REST API backend](#rest-api-backend) for more details.
data/docs/Setup.md CHANGED
@@ -22,6 +22,24 @@ $ bin/rails generate activity_notification:install
22
22
  The generator will install an initializer which describes all configuration options of *activity_notification*.
23
23
  It also generates a i18n based translation file which we can configure the presentation of notifications.
24
24
 
25
+ #### ORM Dependencies
26
+
27
+ By default, *activity_notification* uses **ActiveRecord** as the ORM and no additional ORM gems are required.
28
+
29
+ If you intend to use **Mongoid** support, you need to add the `mongoid` gem separately to your Gemfile:
30
+
31
+ ```ruby
32
+ gem 'activity_notification'
33
+ gem 'mongoid', '>= 4.0.0', '< 10.0'
34
+ ```
35
+
36
+ If you intend to use **Dynamoid** support for Amazon DynamoDB, you need to add the `dynamoid` gem separately to your Gemfile:
37
+
38
+ ```ruby
39
+ gem 'activity_notification'
40
+ gem 'dynamoid', '>= 3.11.0', '< 4.0'
41
+ ```
42
+
25
43
  ### Database setup
26
44
 
27
45
  #### Using ActiveRecord ORM
@@ -64,7 +82,14 @@ config.yaml_column_permitted_classes << Time
64
82
 
65
83
  #### Using Mongoid ORM
66
84
 
67
- When you use *activity_notification* with [Mongoid](http://mongoid.org) ORM, set **AN_ORM** environment variable to **mongoid**:
85
+ When you use *activity_notification* with [Mongoid](http://mongoid.org) ORM, you first need to add the `mongoid` gem to your Gemfile:
86
+
87
+ ```ruby
88
+ gem 'activity_notification'
89
+ gem 'mongoid', '>= 4.0.0', '< 10.0'
90
+ ```
91
+
92
+ Then set **AN_ORM** environment variable to **mongoid**:
68
93
 
69
94
  ```console
70
95
  $ export AN_ORM=mongoid
@@ -80,7 +105,14 @@ You need to configure Mongoid in your Rails application for your MongoDB environ
80
105
 
81
106
  #### Using Dynamoid ORM
82
107
 
83
- When you use *activity_notification* with [Dynamoid](https://github.com/Dynamoid/dynamoid) ORM, set **AN_ORM** environment variable to **dynamoid**:
108
+ When you use *activity_notification* with [Dynamoid](https://github.com/Dynamoid/dynamoid) ORM, you first need to add the `dynamoid` gem to your Gemfile:
109
+
110
+ ```ruby
111
+ gem 'activity_notification'
112
+ gem 'dynamoid', '>= 3.11.0', '< 4.0'
113
+ ```
114
+
115
+ Then set **AN_ORM** environment variable to **dynamoid**:
84
116
 
85
117
  ```console
86
118
  $ export AN_ORM=dynamoid
data/docs/Testing.md CHANGED
@@ -104,6 +104,17 @@ $ bin/rails server
104
104
  ```
105
105
  Then, you can access <http://localhost:3000> for the example application.
106
106
 
107
+ ##### Default test users
108
+
109
+ Login as the following test users to experience user activity notifications:
110
+
111
+ | Email | Password | Admin? |
112
+ |:---:|:---:|:---:|
113
+ | ichiro@example.com | changeit | Yes |
114
+ | stephen@example.com | changeit | |
115
+ | klay@example.com | changeit | |
116
+ | kevin@example.com | changeit | |
117
+
107
118
  ##### Run with your local database
108
119
  As default, example Rails application runs with local SQLite database in *spec/rails_app/db/development.sqlite3*.
109
120
  This application supports to run with your local MySQL, PostgreSQL, MongoDB.
@@ -144,5 +155,5 @@ $ cd spec/rails_app
144
155
  $ # You don't need migration when you use MongoDB only (AN_ORM=mongoid and AN_TEST_DB=mongodb)
145
156
  $ bin/rake db:migrate
146
157
  $ bin/rake db:seed
147
- $ bin/rails server Puma
158
+ $ bin/rails server
148
159
  ```
@@ -85,7 +85,7 @@ module ActivityNotification
85
85
  },
86
86
  subscribed_at: {
87
87
  type: "string",
88
- format: "date-time"
88
+ nullable: true
89
89
  }
90
90
  }
91
91
  }
@@ -1,3 +1,3 @@
1
1
  module ActivityNotification
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
@@ -70,7 +70,7 @@ module ActivityNotification
70
70
  end
71
71
 
72
72
  def committee_options
73
- @committee_options ||= { schema: Committee::Drivers::load_from_file(schema_path), prefix: root_path, validate_success_only: true, parse_response_by_content_type: false }
73
+ @committee_options ||= { schema: Committee::Drivers::load_from_file(schema_path, parser_options: { strict_reference_validation: true }), prefix: root_path, validate_success_only: true, parse_response_by_content_type: false }
74
74
  end
75
75
 
76
76
  def get_with_compatibility path, options = {}
@@ -36,8 +36,15 @@ describe ActivityNotification::Generators::MigrationGenerator, type: :generator
36
36
  if ActivityNotification.config.orm == :active_record
37
37
  it 'can be executed to migrate scheme' do
38
38
  require subject
39
- CreateActivityNotificationTables.new.migrate(:down)
40
- CreateActivityNotificationTables.new.migrate(:up)
39
+ # Suppress migration output during tests
40
+ old_verbose = ActiveRecord::Migration.verbose
41
+ ActiveRecord::Migration.verbose = false
42
+ begin
43
+ CreateActivityNotificationTables.new.migrate(:down)
44
+ CreateActivityNotificationTables.new.migrate(:up)
45
+ ensure
46
+ ActiveRecord::Migration.verbose = old_verbose
47
+ end
41
48
  end
42
49
  end
43
50
  end
@@ -56,8 +63,15 @@ describe ActivityNotification::Generators::MigrationGenerator, type: :generator
56
63
  if ActivityNotification.config.orm == :active_record
57
64
  it 'can be executed to migrate scheme' do
58
65
  require subject
59
- CreateActivityNotificationTables.new.migrate(:down)
60
- CreateActivityNotificationTables.new.migrate(:up)
66
+ # Suppress migration output during tests
67
+ old_verbose = ActiveRecord::Migration.verbose
68
+ ActiveRecord::Migration.verbose = false
69
+ begin
70
+ CreateActivityNotificationTables.new.migrate(:down)
71
+ CreateActivityNotificationTables.new.migrate(:up)
72
+ ensure
73
+ ActiveRecord::Migration.verbose = old_verbose
74
+ end
61
75
  end
62
76
  end
63
77
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activity_notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Yamazaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-19 00:00:00.000000000 Z
11
+ date: 2025-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -30,46 +30,6 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '8.1'
33
- - !ruby/object:Gem::Dependency
34
- name: mongoid
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 4.0.0
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '10.0'
43
- type: :runtime
44
- prerelease: false
45
- version_requirements: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 4.0.0
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '10.0'
53
- - !ruby/object:Gem::Dependency
54
- name: dynamoid
55
- requirement: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: 3.11.0
60
- - - "<"
61
- - !ruby/object:Gem::Version
62
- version: '4.0'
63
- type: :runtime
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: 3.11.0
70
- - - "<"
71
- - !ruby/object:Gem::Version
72
- version: '4.0'
73
33
  - !ruby/object:Gem::Dependency
74
34
  name: i18n
75
35
  requirement: !ruby/object:Gem::Requirement
@@ -168,6 +128,46 @@ dependencies:
168
128
  - - ">="
169
129
  - !ruby/object:Gem::Version
170
130
  version: 1.0.0
131
+ - !ruby/object:Gem::Dependency
132
+ name: mongoid
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: 4.0.0
138
+ - - "<"
139
+ - !ruby/object:Gem::Version
140
+ version: '10.0'
141
+ type: :development
142
+ prerelease: false
143
+ version_requirements: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: 4.0.0
148
+ - - "<"
149
+ - !ruby/object:Gem::Version
150
+ version: '10.0'
151
+ - !ruby/object:Gem::Dependency
152
+ name: dynamoid
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: 3.11.0
158
+ - - "<"
159
+ - !ruby/object:Gem::Version
160
+ version: '4.0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: 3.11.0
168
+ - - "<"
169
+ - !ruby/object:Gem::Version
170
+ version: '4.0'
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: rspec-rails
173
173
  requirement: !ruby/object:Gem::Requirement