activity_notification 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20341262e3b9f892cd609a69a7f5130155592a5b3e43d8d905ec6210b31db68f
4
- data.tar.gz: 4f8f627d667e712420b9ed1e2dccaaaa3fe00e74be3a7c84770a1aecbec39143
3
+ metadata.gz: f21c6ee444304e1291b2f032fe3d8bc485741a89c73123b781ba6f69a883c3d9
4
+ data.tar.gz: 6b80e107e1c256c8fa4acdbe08ba7b62d96b9b6d61f0f912186aac73db720535
5
5
  SHA512:
6
- metadata.gz: f82266c7341114ac6e39aca9d7daee5734a204d7f4f0948d7f8ace6fa047ce1edc3ff3041b776ed32cf38cca343e6f0919b94a348b9c740e1efd4d5b82253e61
7
- data.tar.gz: 725129b9714995fd1b70866e737b535cf2bca972d77ab12353bd1e7f9a11c752313f13d3f4a0d1c9699e60d70a192020b2948b717b38b6912445eb5f90178f6a
6
+ metadata.gz: 1d4a6f4da5491d589d7f0b4433323f270465e35edd758122b5e58fcd30a30e9cada9cc7a5b129246ba114b755940dea5e6550d7e5b7d00ff23d8673bbceafbcf
7
+ data.tar.gz: f240f26d35c835babf447d4b22d2b7acdb1853970a2b50967e9fc3131ec52f73a6dfad86875dc191d69c4993bdca41133dc0005ffcc7f1e6ca8c995ab003d912
@@ -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: :target }
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
@@ -1,3 +1,3 @@
1
1
  module ActivityNotification
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
@@ -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
@@ -0,0 +1,6 @@
1
+ # Copy this template file as aws.rb and set your credentials
2
+ unless Rails.env.test?
3
+ Aws.config.update({
4
+ credentials: Aws::Credentials.new('your_access_key_id', 'your_secret_access_key')
5
+ })
6
+ 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.1.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-10 00:00:00.000000000 Z
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