activity_notification 2.1.1 → 2.1.2
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/app/controllers/activity_notification/notifications_api_with_devise_controller.rb +1 -1
- data/app/controllers/activity_notification/subscriptions_api_with_devise_controller.rb +1 -1
- data/lib/activity_notification/orm/mongoid/subscription.rb +1 -1
- data/lib/activity_notification/version.rb +1 -1
- data/spec/models/subscription_spec.rb +8 -0
- data/spec/rails_app/config/initializers/copy_it.aws.rb.template +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f21c6ee444304e1291b2f032fe3d8bc485741a89c73123b781ba6f69a883c3d9
|
4
|
+
data.tar.gz: 6b80e107e1c256c8fa4acdbe08ba7b62d96b9b6d61f0f912186aac73db720535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d4a6f4da5491d589d7f0b4433323f270465e35edd758122b5e58fcd30a30e9cada9cc7a5b129246ba114b755940dea5e6550d7e5b7d00ff23d8673bbceafbcf
|
7
|
+
data.tar.gz: f240f26d35c835babf447d4b22d2b7acdb1853970a2b50967e9fc3131ec52f73a6dfad86875dc191d69c4993bdca41133dc0005ffcc7f1e6ca8c995ab003d912
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
+
## 2.1.2 / 2020-02-24
|
2
|
+
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.1...v2.1.2)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* 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)
|
7
|
+
* Fix uninitialized constant DeviseTokenAuth when *config.eager_load = true* - [#129](https://github.com/simukappu/activity_notification/issues/129)
|
8
|
+
|
1
9
|
## 2.1.1 / 2020-02-11
|
2
10
|
[Full Changelog](http://github.com/simukappu/activity_notification/compare/v2.1.0...v2.1.1)
|
3
11
|
|
4
12
|
Bug Fixes:
|
13
|
+
|
5
14
|
* Fix eager_load by autoloading VERSION - [#124](https://github.com/simukappu/activity_notification/issues/124) [#125](https://github.com/simukappu/activity_notification/pull/125)
|
6
15
|
|
7
16
|
## 2.1.0 / 2020-02-04
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActivityNotification
|
2
2
|
# Controller to manage notifications API with Devise authentication.
|
3
3
|
class NotificationsApiWithDeviseController < NotificationsApiController
|
4
|
-
include DeviseTokenAuth::Concerns::SetUserByToken
|
4
|
+
include DeviseTokenAuth::Concerns::SetUserByToken if defined?(DeviseTokenAuth)
|
5
5
|
include DeviseAuthenticationController
|
6
6
|
end
|
7
7
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActivityNotification
|
2
2
|
# Controller to manage subscriptions API with Devise authentication.
|
3
3
|
class SubscriptionsApiWithDeviseController < SubscriptionsApiController
|
4
|
-
include DeviseTokenAuth::Concerns::SetUserByToken
|
4
|
+
include DeviseTokenAuth::Concerns::SetUserByToken if defined?(DeviseTokenAuth)
|
5
5
|
include DeviseAuthenticationController
|
6
6
|
end
|
7
7
|
end
|
@@ -28,7 +28,7 @@ module ActivityNotification
|
|
28
28
|
field :optional_targets, type: Hash, default: {}
|
29
29
|
|
30
30
|
validates :target, presence: true
|
31
|
-
validates :key, presence: true, uniqueness: { scope: :
|
31
|
+
validates :key, presence: true, uniqueness: { scope: [:target_type, :target_id] }
|
32
32
|
validates_inclusion_of :subscribing, in: [true, false]
|
33
33
|
validates_inclusion_of :subscribing_to_email, in: [true, false]
|
34
34
|
validate :subscribing_to_email_cannot_be_true_when_subscribing_is_false
|
@@ -11,6 +11,14 @@ describe ActivityNotification::Subscription, type: :model do
|
|
11
11
|
subscription = create(:subscription, target: target)
|
12
12
|
expect(subscription.reload.target).to eq(target)
|
13
13
|
end
|
14
|
+
|
15
|
+
it "several targets can subscribe to the same key" do
|
16
|
+
target = create(:confirmed_user)
|
17
|
+
target2 = create(:confirmed_user)
|
18
|
+
subscription_1 = create(:subscription, target: target, key: 'key.1')
|
19
|
+
subscription_2 = create(:subscription, target: target2, key: 'key.1')
|
20
|
+
expect(subscription_2).to be_valid
|
21
|
+
end
|
14
22
|
end
|
15
23
|
|
16
24
|
describe "with validation" do
|
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.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Yamazaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -621,6 +621,7 @@ files:
|
|
621
621
|
- spec/rails_app/config/initializers/assets.rb
|
622
622
|
- spec/rails_app/config/initializers/backtrace_silencers.rb
|
623
623
|
- spec/rails_app/config/initializers/cookies_serializer.rb
|
624
|
+
- spec/rails_app/config/initializers/copy_it.aws.rb.template
|
624
625
|
- spec/rails_app/config/initializers/devise.rb
|
625
626
|
- spec/rails_app/config/initializers/devise_token_auth.rb
|
626
627
|
- spec/rails_app/config/initializers/filter_parameter_logging.rb
|
@@ -839,6 +840,7 @@ test_files:
|
|
839
840
|
- spec/rails_app/config/initializers/assets.rb
|
840
841
|
- spec/rails_app/config/initializers/backtrace_silencers.rb
|
841
842
|
- spec/rails_app/config/initializers/cookies_serializer.rb
|
843
|
+
- spec/rails_app/config/initializers/copy_it.aws.rb.template
|
842
844
|
- spec/rails_app/config/initializers/devise.rb
|
843
845
|
- spec/rails_app/config/initializers/devise_token_auth.rb
|
844
846
|
- spec/rails_app/config/initializers/filter_parameter_logging.rb
|