activity_notification 1.4.2 → 1.4.3

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
  SHA1:
3
- metadata.gz: f2a8ddee8ebe99622eaabfc2827b1163625f5eaa
4
- data.tar.gz: d55b69c877f4cf2d04ad1fc3397314b71da72333
3
+ metadata.gz: 98b67798537c916b0c93dcc82db6c130c31dc346
4
+ data.tar.gz: 9e2910dc3d3dc59774cceb2da6d488a16bb6d328
5
5
  SHA512:
6
- metadata.gz: 795e3e038b7e329b567018afc4b9ae2eb4d98fcb4283500092267fb6bbbdf34a5abf1f66823ed5677bd840856c519fa6e3b1b1bf9e41e2dd2d2dea1abbe478f2
7
- data.tar.gz: 7f6d257a66540873366c4122632beceee21126598467c82243cd526953ea3050d4a054b9ba11f8c833c2c117f65d3400cef65af4b6b9831e717018cbc328120e
6
+ metadata.gz: 73ed19c914566c4b224d9618858feefe077a6bb57a53fe6d0664b2ff9db5b4e771e8cc7f3bc1ad06859d3fcf357a4d52abc6133a69660356844093006dd94ba2
7
+ data.tar.gz: c427bc0215d1ff4c9c8e0c27a27eadad5131753b31e2a935dd02b0f8b66a8da67389351c4e8e34644337ec3769d9e1563f5ad2f3d097500ec309a80611d17ba6
@@ -1,3 +1,14 @@
1
+ ## 1.4.2 / 2017-09-16
2
+ [Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.4.2...v1.4.3)
3
+
4
+ Enhancements:
5
+
6
+ * Add *:pass_full_options* option to *NotificationApi#notify* passing the entire options to notification targets
7
+
8
+ Bug Fixes:
9
+
10
+ * Add `{ optional: true }` for *:group* and *:notifier* when it is used with Rails 5
11
+
1
12
  ## 1.4.2 / 2017-07-22
2
13
  [Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.4.1...v1.4.2)
3
14
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activity_notification (1.4.2)
4
+ activity_notification (1.4.3)
5
5
  i18n (>= 0.5.0)
6
6
  jquery-rails (>= 3.1.1)
7
7
  railties (>= 4.2.0, < 5.2)
@@ -9,39 +9,39 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.1.2)
13
- actionpack (= 5.1.2)
12
+ actioncable (5.1.4)
13
+ actionpack (= 5.1.4)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (~> 0.6.1)
16
- actionmailer (5.1.2)
17
- actionpack (= 5.1.2)
18
- actionview (= 5.1.2)
19
- activejob (= 5.1.2)
16
+ actionmailer (5.1.4)
17
+ actionpack (= 5.1.4)
18
+ actionview (= 5.1.4)
19
+ activejob (= 5.1.4)
20
20
  mail (~> 2.5, >= 2.5.4)
21
21
  rails-dom-testing (~> 2.0)
22
- actionpack (5.1.2)
23
- actionview (= 5.1.2)
24
- activesupport (= 5.1.2)
22
+ actionpack (5.1.4)
23
+ actionview (= 5.1.4)
24
+ activesupport (= 5.1.4)
25
25
  rack (~> 2.0)
26
- rack-test (~> 0.6.3)
26
+ rack-test (>= 0.6.3)
27
27
  rails-dom-testing (~> 2.0)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.1.2)
30
- activesupport (= 5.1.2)
29
+ actionview (5.1.4)
30
+ activesupport (= 5.1.4)
31
31
  builder (~> 3.1)
32
32
  erubi (~> 1.4)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.1.2)
36
- activesupport (= 5.1.2)
35
+ activejob (5.1.4)
36
+ activesupport (= 5.1.4)
37
37
  globalid (>= 0.3.6)
38
- activemodel (5.1.2)
39
- activesupport (= 5.1.2)
40
- activerecord (5.1.2)
41
- activemodel (= 5.1.2)
42
- activesupport (= 5.1.2)
38
+ activemodel (5.1.4)
39
+ activesupport (= 5.1.4)
40
+ activerecord (5.1.4)
41
+ activemodel (= 5.1.4)
42
+ activesupport (= 5.1.4)
43
43
  arel (~> 8.0)
44
- activesupport (5.1.2)
44
+ activesupport (5.1.4)
45
45
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
46
  i18n (~> 0.7)
47
47
  minitest (~> 5.1)
@@ -51,27 +51,27 @@ GEM
51
51
  railties (>= 3.0)
52
52
  rspec-rails (>= 2.2)
53
53
  arel (8.0.0)
54
- aws-sdk (2.10.15)
55
- aws-sdk-resources (= 2.10.15)
56
- aws-sdk-core (2.10.15)
54
+ aws-sdk (2.10.47)
55
+ aws-sdk-resources (= 2.10.47)
56
+ aws-sdk-core (2.10.47)
57
57
  aws-sigv4 (~> 1.0)
58
58
  jmespath (~> 1.0)
59
- aws-sdk-resources (2.10.15)
60
- aws-sdk-core (= 2.10.15)
61
- aws-sigv4 (1.0.1)
59
+ aws-sdk-resources (2.10.47)
60
+ aws-sdk-core (= 2.10.47)
61
+ aws-sigv4 (1.0.2)
62
62
  bcrypt (3.1.11)
63
63
  bson (4.2.2)
64
64
  builder (3.2.3)
65
- bullet (5.6.0)
65
+ bullet (5.6.1)
66
66
  activesupport (>= 3.0.0)
67
67
  uniform_notifier (~> 1.10.0)
68
68
  concurrent-ruby (1.0.5)
69
- coveralls (0.8.21)
70
- json (>= 1.8, < 3)
71
- simplecov (~> 0.14.1)
72
- term-ansicolor (~> 1.3)
73
- thor (~> 0.19.4)
74
- tins (~> 1.6)
69
+ coveralls (0.7.2)
70
+ multi_json (~> 1.3)
71
+ rest-client (= 1.6.7)
72
+ simplecov (>= 0.7)
73
+ term-ansicolor (= 1.2.2)
74
+ thor (= 0.18.1)
75
75
  devise (4.3.0)
76
76
  bcrypt (~> 3.0)
77
77
  orm_adapter (~> 0.1)
@@ -109,31 +109,32 @@ GEM
109
109
  mime-types-data (3.2016.0521)
110
110
  mini_portile2 (2.2.0)
111
111
  minitest (5.10.3)
112
- mongo (2.4.2)
112
+ mongo (2.4.3)
113
113
  bson (>= 4.2.1, < 5.0.0)
114
- mongoid (6.2.0)
114
+ mongoid (6.2.1)
115
115
  activemodel (~> 5.1)
116
116
  mongo (>= 2.4.1, < 3.0.0)
117
- mysql2 (0.4.8)
117
+ multi_json (1.12.2)
118
+ mysql2 (0.4.9)
118
119
  nio4r (2.1.0)
119
120
  nokogiri (1.8.0)
120
121
  mini_portile2 (~> 2.2.0)
121
122
  orm_adapter (0.5.0)
122
123
  pg (0.21.0)
123
124
  rack (2.0.3)
124
- rack-test (0.6.3)
125
- rack (>= 1.0)
126
- rails (5.1.2)
127
- actioncable (= 5.1.2)
128
- actionmailer (= 5.1.2)
129
- actionpack (= 5.1.2)
130
- actionview (= 5.1.2)
131
- activejob (= 5.1.2)
132
- activemodel (= 5.1.2)
133
- activerecord (= 5.1.2)
134
- activesupport (= 5.1.2)
135
- bundler (>= 1.3.0, < 2.0)
136
- railties (= 5.1.2)
125
+ rack-test (0.7.0)
126
+ rack (>= 1.0, < 3)
127
+ rails (5.1.4)
128
+ actioncable (= 5.1.4)
129
+ actionmailer (= 5.1.4)
130
+ actionpack (= 5.1.4)
131
+ actionview (= 5.1.4)
132
+ activejob (= 5.1.4)
133
+ activemodel (= 5.1.4)
134
+ activerecord (= 5.1.4)
135
+ activesupport (= 5.1.4)
136
+ bundler (>= 1.3.0)
137
+ railties (= 5.1.4)
137
138
  sprockets-rails (>= 2.0.0)
138
139
  rails-controller-testing (1.0.2)
139
140
  actionpack (~> 5.x, >= 5.0.1)
@@ -144,16 +145,18 @@ GEM
144
145
  nokogiri (>= 1.6)
145
146
  rails-html-sanitizer (1.0.3)
146
147
  loofah (~> 2.0)
147
- railties (5.1.2)
148
- actionpack (= 5.1.2)
149
- activesupport (= 5.1.2)
148
+ railties (5.1.4)
149
+ actionpack (= 5.1.4)
150
+ activesupport (= 5.1.4)
150
151
  method_source
151
152
  rake (>= 0.8.7)
152
153
  thor (>= 0.18.1, < 2.0)
153
- rake (12.0.0)
154
+ rake (12.1.0)
154
155
  responders (2.4.0)
155
156
  actionpack (>= 4.2.0, < 5.3)
156
157
  railties (>= 4.2.0, < 5.3)
158
+ rest-client (1.6.7)
159
+ mime-types (>= 1.16)
157
160
  rspec-core (3.6.0)
158
161
  rspec-support (~> 3.6.0)
159
162
  rspec-expectations (3.6.0)
@@ -162,7 +165,7 @@ GEM
162
165
  rspec-mocks (3.6.0)
163
166
  diff-lcs (>= 1.2.0, < 2.0)
164
167
  rspec-support (~> 3.6.0)
165
- rspec-rails (3.6.0)
168
+ rspec-rails (3.6.1)
166
169
  actionpack (>= 3.0)
167
170
  activesupport (>= 3.0)
168
171
  railties (>= 3.0)
@@ -171,26 +174,26 @@ GEM
171
174
  rspec-mocks (~> 3.6.0)
172
175
  rspec-support (~> 3.6.0)
173
176
  rspec-support (3.6.0)
174
- simplecov (0.14.1)
177
+ simplecov (0.15.1)
175
178
  docile (~> 1.1.0)
176
179
  json (>= 1.8, < 3)
177
180
  simplecov-html (~> 0.10.0)
178
- simplecov-html (0.10.1)
179
- slack-notifier (2.2.2)
181
+ simplecov-html (0.10.2)
182
+ slack-notifier (2.3.1)
180
183
  sprockets (3.7.1)
181
184
  concurrent-ruby (~> 1.0)
182
185
  rack (> 1, < 3)
183
- sprockets-rails (3.2.0)
186
+ sprockets-rails (3.2.1)
184
187
  actionpack (>= 4.0)
185
188
  activesupport (>= 4.0)
186
189
  sprockets (>= 3.0.0)
187
190
  sqlite3 (1.3.13)
188
- term-ansicolor (1.6.0)
189
- tins (~> 1.0)
190
- thor (0.19.4)
191
+ term-ansicolor (1.2.2)
192
+ tins (~> 0.8)
193
+ thor (0.18.1)
191
194
  thread_safe (0.3.6)
192
195
  timecop (0.9.1)
193
- tins (1.15.0)
196
+ tins (0.13.2)
194
197
  tzinfo (1.2.3)
195
198
  thread_safe (~> 0.1)
196
199
  uniform_notifier (1.10.0)
@@ -216,12 +219,12 @@ DEPENDENCIES
216
219
  dotenv-rails
217
220
  factory_girl_rails (~> 4.8.0)
218
221
  mongoid (>= 4.0.0)
219
- mysql2 (~> 0.4.8)
222
+ mysql2 (~> 0.4.9)
220
223
  pg (~> 0.21.0)
221
224
  rails (~> 5.1)
222
225
  rails-controller-testing
223
- rspec-rails (~> 3.6.0)
224
- simplecov (~> 0.14.1)
226
+ rspec-rails (~> 3.6.1)
227
+ simplecov (~> 0.15.1)
225
228
  slack-notifier (>= 1.5.1)
226
229
  sqlite3 (~> 1.3.13)
227
230
  timecop
@@ -25,12 +25,12 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'jquery-rails', '>= 3.1.1'
26
26
 
27
27
  s.add_development_dependency 'sqlite3', '~> 1.3.13'
28
- s.add_development_dependency 'mysql2', '~> 0.4.8'
28
+ s.add_development_dependency 'mysql2', '~> 0.4.9'
29
29
  s.add_development_dependency 'pg', '~> 0.21.0'
30
30
  s.add_development_dependency 'mongoid', '>= 4.0.0'
31
- s.add_development_dependency 'rspec-rails', '~> 3.6.0'
31
+ s.add_development_dependency 'rspec-rails', '~> 3.6.1'
32
32
  s.add_development_dependency 'factory_girl_rails', '~> 4.8.0'
33
- s.add_development_dependency 'simplecov', '~> 0.14.1'
33
+ s.add_development_dependency 'simplecov', '~> 0.15.1'
34
34
  s.add_development_dependency 'yard', '~> 0.9.9'
35
35
  s.add_development_dependency 'yard-activesupport-concern', '~> 0.0.1'
36
36
  s.add_development_dependency 'devise', '~> 4.3.0'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- activity_notification (1.4.2)
4
+ activity_notification (1.4.3)
5
5
  i18n (>= 0.5.0)
6
6
  jquery-rails (>= 3.1.1)
7
7
  railties (>= 4.2.0, < 5.2)
@@ -48,27 +48,27 @@ GEM
48
48
  railties (>= 3.0)
49
49
  rspec-rails (>= 2.2)
50
50
  arel (6.0.4)
51
- aws-sdk (2.10.15)
52
- aws-sdk-resources (= 2.10.15)
53
- aws-sdk-core (2.10.15)
51
+ aws-sdk (2.10.47)
52
+ aws-sdk-resources (= 2.10.47)
53
+ aws-sdk-core (2.10.47)
54
54
  aws-sigv4 (~> 1.0)
55
55
  jmespath (~> 1.0)
56
- aws-sdk-resources (2.10.15)
57
- aws-sdk-core (= 2.10.15)
58
- aws-sigv4 (1.0.1)
56
+ aws-sdk-resources (2.10.47)
57
+ aws-sdk-core (= 2.10.47)
58
+ aws-sigv4 (1.0.2)
59
59
  bcrypt (3.1.11)
60
60
  bson (4.2.2)
61
61
  builder (3.2.3)
62
- bullet (5.6.0)
62
+ bullet (5.6.1)
63
63
  activesupport (>= 3.0.0)
64
64
  uniform_notifier (~> 1.10.0)
65
65
  concurrent-ruby (1.0.5)
66
- coveralls (0.8.21)
67
- json (>= 1.8, < 3)
68
- simplecov (~> 0.14.1)
69
- term-ansicolor (~> 1.3)
70
- thor (~> 0.19.4)
71
- tins (~> 1.6)
66
+ coveralls (0.7.2)
67
+ multi_json (~> 1.3)
68
+ rest-client (= 1.6.7)
69
+ simplecov (>= 0.7)
70
+ term-ansicolor (= 1.2.2)
71
+ thor (= 0.18.1)
72
72
  devise (4.3.0)
73
73
  bcrypt (~> 3.0)
74
74
  orm_adapter (~> 0.1)
@@ -105,14 +105,15 @@ GEM
105
105
  mime-types-data (3.2016.0521)
106
106
  mini_portile2 (2.2.0)
107
107
  minitest (5.10.3)
108
- mongo (2.4.2)
108
+ mongo (2.4.3)
109
109
  bson (>= 4.2.1, < 5.0.0)
110
110
  mongoid (5.2.1)
111
111
  activemodel (~> 4.0)
112
112
  mongo (>= 2.4.1, < 3.0.0)
113
113
  origin (~> 2.3)
114
114
  tzinfo (>= 0.3.37)
115
- mysql2 (0.4.8)
115
+ multi_json (1.12.2)
116
+ mysql2 (0.4.9)
116
117
  nokogiri (1.8.0)
117
118
  mini_portile2 (~> 2.2.0)
118
119
  origin (2.3.1)
@@ -145,10 +146,12 @@ GEM
145
146
  activesupport (= 4.2.9)
146
147
  rake (>= 0.8.7)
147
148
  thor (>= 0.18.1, < 2.0)
148
- rake (12.0.0)
149
+ rake (12.1.0)
149
150
  responders (2.4.0)
150
151
  actionpack (>= 4.2.0, < 5.3)
151
152
  railties (>= 4.2.0, < 5.3)
153
+ rest-client (1.6.7)
154
+ mime-types (>= 1.16)
152
155
  rspec-core (3.6.0)
153
156
  rspec-support (~> 3.6.0)
154
157
  rspec-expectations (3.6.0)
@@ -157,7 +160,7 @@ GEM
157
160
  rspec-mocks (3.6.0)
158
161
  diff-lcs (>= 1.2.0, < 2.0)
159
162
  rspec-support (~> 3.6.0)
160
- rspec-rails (3.6.0)
163
+ rspec-rails (3.6.1)
161
164
  actionpack (>= 3.0)
162
165
  activesupport (>= 3.0)
163
166
  railties (>= 3.0)
@@ -166,26 +169,26 @@ GEM
166
169
  rspec-mocks (~> 3.6.0)
167
170
  rspec-support (~> 3.6.0)
168
171
  rspec-support (3.6.0)
169
- simplecov (0.14.1)
172
+ simplecov (0.15.1)
170
173
  docile (~> 1.1.0)
171
174
  json (>= 1.8, < 3)
172
175
  simplecov-html (~> 0.10.0)
173
- simplecov-html (0.10.1)
174
- slack-notifier (2.2.2)
176
+ simplecov-html (0.10.2)
177
+ slack-notifier (2.3.1)
175
178
  sprockets (3.7.1)
176
179
  concurrent-ruby (~> 1.0)
177
180
  rack (> 1, < 3)
178
- sprockets-rails (3.2.0)
181
+ sprockets-rails (3.2.1)
179
182
  actionpack (>= 4.0)
180
183
  activesupport (>= 4.0)
181
184
  sprockets (>= 3.0.0)
182
185
  sqlite3 (1.3.13)
183
- term-ansicolor (1.6.0)
184
- tins (~> 1.0)
185
- thor (0.19.4)
186
+ term-ansicolor (1.2.2)
187
+ tins (~> 0.8)
188
+ thor (0.18.1)
186
189
  thread_safe (0.3.6)
187
190
  timecop (0.9.1)
188
- tins (1.15.0)
191
+ tins (0.13.2)
189
192
  tzinfo (1.2.3)
190
193
  thread_safe (~> 0.1)
191
194
  uniform_notifier (1.10.0)
@@ -208,11 +211,11 @@ DEPENDENCIES
208
211
  dotenv-rails
209
212
  factory_girl_rails (~> 4.8.0)
210
213
  mongoid (>= 4.0.0)
211
- mysql2 (~> 0.4.8)
214
+ mysql2 (~> 0.4.9)
212
215
  pg (~> 0.21.0)
213
216
  rails (~> 4.2.0)
214
- rspec-rails (~> 3.6.0)
215
- simplecov (~> 0.14.1)
217
+ rspec-rails (~> 3.6.1)
218
+ simplecov (~> 0.15.1)
216
219
  slack-notifier (>= 1.5.1)
217
220
  sqlite3 (~> 1.3.13)
218
221
  timecop
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- activity_notification (1.4.2)
4
+ activity_notification (1.4.3)
5
5
  i18n (>= 0.5.0)
6
6
  jquery-rails (>= 3.1.1)
7
7
  railties (>= 4.2.0, < 5.2)
@@ -9,39 +9,39 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.0.4)
13
- actionpack (= 5.0.4)
12
+ actioncable (5.0.6)
13
+ actionpack (= 5.0.6)
14
14
  nio4r (>= 1.2, < 3.0)
15
15
  websocket-driver (~> 0.6.1)
16
- actionmailer (5.0.4)
17
- actionpack (= 5.0.4)
18
- actionview (= 5.0.4)
19
- activejob (= 5.0.4)
16
+ actionmailer (5.0.6)
17
+ actionpack (= 5.0.6)
18
+ actionview (= 5.0.6)
19
+ activejob (= 5.0.6)
20
20
  mail (~> 2.5, >= 2.5.4)
21
21
  rails-dom-testing (~> 2.0)
22
- actionpack (5.0.4)
23
- actionview (= 5.0.4)
24
- activesupport (= 5.0.4)
22
+ actionpack (5.0.6)
23
+ actionview (= 5.0.6)
24
+ activesupport (= 5.0.6)
25
25
  rack (~> 2.0)
26
26
  rack-test (~> 0.6.3)
27
27
  rails-dom-testing (~> 2.0)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.0.4)
30
- activesupport (= 5.0.4)
29
+ actionview (5.0.6)
30
+ activesupport (= 5.0.6)
31
31
  builder (~> 3.1)
32
32
  erubis (~> 2.7.0)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.0.4)
36
- activesupport (= 5.0.4)
35
+ activejob (5.0.6)
36
+ activesupport (= 5.0.6)
37
37
  globalid (>= 0.3.6)
38
- activemodel (5.0.4)
39
- activesupport (= 5.0.4)
40
- activerecord (5.0.4)
41
- activemodel (= 5.0.4)
42
- activesupport (= 5.0.4)
38
+ activemodel (5.0.6)
39
+ activesupport (= 5.0.6)
40
+ activerecord (5.0.6)
41
+ activemodel (= 5.0.6)
42
+ activesupport (= 5.0.6)
43
43
  arel (~> 7.0)
44
- activesupport (5.0.4)
44
+ activesupport (5.0.6)
45
45
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
46
  i18n (~> 0.7)
47
47
  minitest (~> 5.1)
@@ -51,27 +51,27 @@ GEM
51
51
  railties (>= 3.0)
52
52
  rspec-rails (>= 2.2)
53
53
  arel (7.1.4)
54
- aws-sdk (2.10.15)
55
- aws-sdk-resources (= 2.10.15)
56
- aws-sdk-core (2.10.15)
54
+ aws-sdk (2.10.47)
55
+ aws-sdk-resources (= 2.10.47)
56
+ aws-sdk-core (2.10.47)
57
57
  aws-sigv4 (~> 1.0)
58
58
  jmespath (~> 1.0)
59
- aws-sdk-resources (2.10.15)
60
- aws-sdk-core (= 2.10.15)
61
- aws-sigv4 (1.0.1)
59
+ aws-sdk-resources (2.10.47)
60
+ aws-sdk-core (= 2.10.47)
61
+ aws-sigv4 (1.0.2)
62
62
  bcrypt (3.1.11)
63
63
  bson (4.2.2)
64
64
  builder (3.2.3)
65
- bullet (5.6.0)
65
+ bullet (5.6.1)
66
66
  activesupport (>= 3.0.0)
67
67
  uniform_notifier (~> 1.10.0)
68
68
  concurrent-ruby (1.0.5)
69
- coveralls (0.8.21)
70
- json (>= 1.8, < 3)
71
- simplecov (~> 0.14.1)
72
- term-ansicolor (~> 1.3)
73
- thor (~> 0.19.4)
74
- tins (~> 1.6)
69
+ coveralls (0.7.2)
70
+ multi_json (~> 1.3)
71
+ rest-client (= 1.6.7)
72
+ simplecov (>= 0.7)
73
+ term-ansicolor (= 1.2.2)
74
+ thor (= 0.18.1)
75
75
  devise (4.3.0)
76
76
  bcrypt (~> 3.0)
77
77
  orm_adapter (~> 0.1)
@@ -109,12 +109,13 @@ GEM
109
109
  mime-types-data (3.2016.0521)
110
110
  mini_portile2 (2.2.0)
111
111
  minitest (5.10.3)
112
- mongo (2.4.2)
112
+ mongo (2.4.3)
113
113
  bson (>= 4.2.1, < 5.0.0)
114
114
  mongoid (6.1.1)
115
115
  activemodel (~> 5.0)
116
116
  mongo (>= 2.4.1, < 3.0.0)
117
- mysql2 (0.4.8)
117
+ multi_json (1.12.2)
118
+ mysql2 (0.4.9)
118
119
  nio4r (2.1.0)
119
120
  nokogiri (1.8.0)
120
121
  mini_portile2 (~> 2.2.0)
@@ -123,17 +124,17 @@ GEM
123
124
  rack (2.0.3)
124
125
  rack-test (0.6.3)
125
126
  rack (>= 1.0)
126
- rails (5.0.4)
127
- actioncable (= 5.0.4)
128
- actionmailer (= 5.0.4)
129
- actionpack (= 5.0.4)
130
- actionview (= 5.0.4)
131
- activejob (= 5.0.4)
132
- activemodel (= 5.0.4)
133
- activerecord (= 5.0.4)
134
- activesupport (= 5.0.4)
135
- bundler (>= 1.3.0, < 2.0)
136
- railties (= 5.0.4)
127
+ rails (5.0.6)
128
+ actioncable (= 5.0.6)
129
+ actionmailer (= 5.0.6)
130
+ actionpack (= 5.0.6)
131
+ actionview (= 5.0.6)
132
+ activejob (= 5.0.6)
133
+ activemodel (= 5.0.6)
134
+ activerecord (= 5.0.6)
135
+ activesupport (= 5.0.6)
136
+ bundler (>= 1.3.0)
137
+ railties (= 5.0.6)
137
138
  sprockets-rails (>= 2.0.0)
138
139
  rails-controller-testing (1.0.2)
139
140
  actionpack (~> 5.x, >= 5.0.1)
@@ -144,16 +145,18 @@ GEM
144
145
  nokogiri (>= 1.6)
145
146
  rails-html-sanitizer (1.0.3)
146
147
  loofah (~> 2.0)
147
- railties (5.0.4)
148
- actionpack (= 5.0.4)
149
- activesupport (= 5.0.4)
148
+ railties (5.0.6)
149
+ actionpack (= 5.0.6)
150
+ activesupport (= 5.0.6)
150
151
  method_source
151
152
  rake (>= 0.8.7)
152
153
  thor (>= 0.18.1, < 2.0)
153
- rake (12.0.0)
154
+ rake (12.1.0)
154
155
  responders (2.4.0)
155
156
  actionpack (>= 4.2.0, < 5.3)
156
157
  railties (>= 4.2.0, < 5.3)
158
+ rest-client (1.6.7)
159
+ mime-types (>= 1.16)
157
160
  rspec-core (3.6.0)
158
161
  rspec-support (~> 3.6.0)
159
162
  rspec-expectations (3.6.0)
@@ -162,7 +165,7 @@ GEM
162
165
  rspec-mocks (3.6.0)
163
166
  diff-lcs (>= 1.2.0, < 2.0)
164
167
  rspec-support (~> 3.6.0)
165
- rspec-rails (3.6.0)
168
+ rspec-rails (3.6.1)
166
169
  actionpack (>= 3.0)
167
170
  activesupport (>= 3.0)
168
171
  railties (>= 3.0)
@@ -171,26 +174,26 @@ GEM
171
174
  rspec-mocks (~> 3.6.0)
172
175
  rspec-support (~> 3.6.0)
173
176
  rspec-support (3.6.0)
174
- simplecov (0.14.1)
177
+ simplecov (0.15.1)
175
178
  docile (~> 1.1.0)
176
179
  json (>= 1.8, < 3)
177
180
  simplecov-html (~> 0.10.0)
178
- simplecov-html (0.10.1)
179
- slack-notifier (2.2.2)
181
+ simplecov-html (0.10.2)
182
+ slack-notifier (2.3.1)
180
183
  sprockets (3.7.1)
181
184
  concurrent-ruby (~> 1.0)
182
185
  rack (> 1, < 3)
183
- sprockets-rails (3.2.0)
186
+ sprockets-rails (3.2.1)
184
187
  actionpack (>= 4.0)
185
188
  activesupport (>= 4.0)
186
189
  sprockets (>= 3.0.0)
187
190
  sqlite3 (1.3.13)
188
- term-ansicolor (1.6.0)
189
- tins (~> 1.0)
190
- thor (0.19.4)
191
+ term-ansicolor (1.2.2)
192
+ tins (~> 0.8)
193
+ thor (0.18.1)
191
194
  thread_safe (0.3.6)
192
195
  timecop (0.9.1)
193
- tins (1.15.0)
196
+ tins (0.13.2)
194
197
  tzinfo (1.2.3)
195
198
  thread_safe (~> 0.1)
196
199
  uniform_notifier (1.10.0)
@@ -216,12 +219,12 @@ DEPENDENCIES
216
219
  dotenv-rails
217
220
  factory_girl_rails (~> 4.8.0)
218
221
  mongoid (>= 4.0.0)
219
- mysql2 (~> 0.4.8)
222
+ mysql2 (~> 0.4.9)
220
223
  pg (~> 0.21.0)
221
224
  rails (~> 5.0.0)
222
225
  rails-controller-testing
223
- rspec-rails (~> 3.6.0)
224
- simplecov (~> 0.14.1)
226
+ rspec-rails (~> 3.6.1)
227
+ simplecov (~> 0.15.1)
225
228
  slack-notifier (>= 1.5.1)
226
229
  sqlite3 (~> 1.3.13)
227
230
  timecop
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- activity_notification (1.4.2)
4
+ activity_notification (1.4.3)
5
5
  i18n (>= 0.5.0)
6
6
  jquery-rails (>= 3.1.1)
7
7
  railties (>= 4.2.0, < 5.2)
@@ -9,39 +9,39 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.1.2)
13
- actionpack (= 5.1.2)
12
+ actioncable (5.1.4)
13
+ actionpack (= 5.1.4)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (~> 0.6.1)
16
- actionmailer (5.1.2)
17
- actionpack (= 5.1.2)
18
- actionview (= 5.1.2)
19
- activejob (= 5.1.2)
16
+ actionmailer (5.1.4)
17
+ actionpack (= 5.1.4)
18
+ actionview (= 5.1.4)
19
+ activejob (= 5.1.4)
20
20
  mail (~> 2.5, >= 2.5.4)
21
21
  rails-dom-testing (~> 2.0)
22
- actionpack (5.1.2)
23
- actionview (= 5.1.2)
24
- activesupport (= 5.1.2)
22
+ actionpack (5.1.4)
23
+ actionview (= 5.1.4)
24
+ activesupport (= 5.1.4)
25
25
  rack (~> 2.0)
26
- rack-test (~> 0.6.3)
26
+ rack-test (>= 0.6.3)
27
27
  rails-dom-testing (~> 2.0)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.1.2)
30
- activesupport (= 5.1.2)
29
+ actionview (5.1.4)
30
+ activesupport (= 5.1.4)
31
31
  builder (~> 3.1)
32
32
  erubi (~> 1.4)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.1.2)
36
- activesupport (= 5.1.2)
35
+ activejob (5.1.4)
36
+ activesupport (= 5.1.4)
37
37
  globalid (>= 0.3.6)
38
- activemodel (5.1.2)
39
- activesupport (= 5.1.2)
40
- activerecord (5.1.2)
41
- activemodel (= 5.1.2)
42
- activesupport (= 5.1.2)
38
+ activemodel (5.1.4)
39
+ activesupport (= 5.1.4)
40
+ activerecord (5.1.4)
41
+ activemodel (= 5.1.4)
42
+ activesupport (= 5.1.4)
43
43
  arel (~> 8.0)
44
- activesupport (5.1.2)
44
+ activesupport (5.1.4)
45
45
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
46
  i18n (~> 0.7)
47
47
  minitest (~> 5.1)
@@ -51,27 +51,27 @@ GEM
51
51
  railties (>= 3.0)
52
52
  rspec-rails (>= 2.2)
53
53
  arel (8.0.0)
54
- aws-sdk (2.10.15)
55
- aws-sdk-resources (= 2.10.15)
56
- aws-sdk-core (2.10.15)
54
+ aws-sdk (2.10.47)
55
+ aws-sdk-resources (= 2.10.47)
56
+ aws-sdk-core (2.10.47)
57
57
  aws-sigv4 (~> 1.0)
58
58
  jmespath (~> 1.0)
59
- aws-sdk-resources (2.10.15)
60
- aws-sdk-core (= 2.10.15)
61
- aws-sigv4 (1.0.1)
59
+ aws-sdk-resources (2.10.47)
60
+ aws-sdk-core (= 2.10.47)
61
+ aws-sigv4 (1.0.2)
62
62
  bcrypt (3.1.11)
63
63
  bson (4.2.2)
64
64
  builder (3.2.3)
65
- bullet (5.6.0)
65
+ bullet (5.6.1)
66
66
  activesupport (>= 3.0.0)
67
67
  uniform_notifier (~> 1.10.0)
68
68
  concurrent-ruby (1.0.5)
69
- coveralls (0.8.21)
70
- json (>= 1.8, < 3)
71
- simplecov (~> 0.14.1)
72
- term-ansicolor (~> 1.3)
73
- thor (~> 0.19.4)
74
- tins (~> 1.6)
69
+ coveralls (0.7.2)
70
+ multi_json (~> 1.3)
71
+ rest-client (= 1.6.7)
72
+ simplecov (>= 0.7)
73
+ term-ansicolor (= 1.2.2)
74
+ thor (= 0.18.1)
75
75
  devise (4.3.0)
76
76
  bcrypt (~> 3.0)
77
77
  orm_adapter (~> 0.1)
@@ -109,31 +109,32 @@ GEM
109
109
  mime-types-data (3.2016.0521)
110
110
  mini_portile2 (2.2.0)
111
111
  minitest (5.10.3)
112
- mongo (2.4.2)
112
+ mongo (2.4.3)
113
113
  bson (>= 4.2.1, < 5.0.0)
114
- mongoid (6.2.0)
114
+ mongoid (6.2.1)
115
115
  activemodel (~> 5.1)
116
116
  mongo (>= 2.4.1, < 3.0.0)
117
- mysql2 (0.4.8)
117
+ multi_json (1.12.2)
118
+ mysql2 (0.4.9)
118
119
  nio4r (2.1.0)
119
120
  nokogiri (1.8.0)
120
121
  mini_portile2 (~> 2.2.0)
121
122
  orm_adapter (0.5.0)
122
123
  pg (0.21.0)
123
124
  rack (2.0.3)
124
- rack-test (0.6.3)
125
- rack (>= 1.0)
126
- rails (5.1.2)
127
- actioncable (= 5.1.2)
128
- actionmailer (= 5.1.2)
129
- actionpack (= 5.1.2)
130
- actionview (= 5.1.2)
131
- activejob (= 5.1.2)
132
- activemodel (= 5.1.2)
133
- activerecord (= 5.1.2)
134
- activesupport (= 5.1.2)
135
- bundler (>= 1.3.0, < 2.0)
136
- railties (= 5.1.2)
125
+ rack-test (0.7.0)
126
+ rack (>= 1.0, < 3)
127
+ rails (5.1.4)
128
+ actioncable (= 5.1.4)
129
+ actionmailer (= 5.1.4)
130
+ actionpack (= 5.1.4)
131
+ actionview (= 5.1.4)
132
+ activejob (= 5.1.4)
133
+ activemodel (= 5.1.4)
134
+ activerecord (= 5.1.4)
135
+ activesupport (= 5.1.4)
136
+ bundler (>= 1.3.0)
137
+ railties (= 5.1.4)
137
138
  sprockets-rails (>= 2.0.0)
138
139
  rails-controller-testing (1.0.2)
139
140
  actionpack (~> 5.x, >= 5.0.1)
@@ -144,16 +145,18 @@ GEM
144
145
  nokogiri (>= 1.6)
145
146
  rails-html-sanitizer (1.0.3)
146
147
  loofah (~> 2.0)
147
- railties (5.1.2)
148
- actionpack (= 5.1.2)
149
- activesupport (= 5.1.2)
148
+ railties (5.1.4)
149
+ actionpack (= 5.1.4)
150
+ activesupport (= 5.1.4)
150
151
  method_source
151
152
  rake (>= 0.8.7)
152
153
  thor (>= 0.18.1, < 2.0)
153
- rake (12.0.0)
154
+ rake (12.1.0)
154
155
  responders (2.4.0)
155
156
  actionpack (>= 4.2.0, < 5.3)
156
157
  railties (>= 4.2.0, < 5.3)
158
+ rest-client (1.6.7)
159
+ mime-types (>= 1.16)
157
160
  rspec-core (3.6.0)
158
161
  rspec-support (~> 3.6.0)
159
162
  rspec-expectations (3.6.0)
@@ -162,7 +165,7 @@ GEM
162
165
  rspec-mocks (3.6.0)
163
166
  diff-lcs (>= 1.2.0, < 2.0)
164
167
  rspec-support (~> 3.6.0)
165
- rspec-rails (3.6.0)
168
+ rspec-rails (3.6.1)
166
169
  actionpack (>= 3.0)
167
170
  activesupport (>= 3.0)
168
171
  railties (>= 3.0)
@@ -171,26 +174,26 @@ GEM
171
174
  rspec-mocks (~> 3.6.0)
172
175
  rspec-support (~> 3.6.0)
173
176
  rspec-support (3.6.0)
174
- simplecov (0.14.1)
177
+ simplecov (0.15.1)
175
178
  docile (~> 1.1.0)
176
179
  json (>= 1.8, < 3)
177
180
  simplecov-html (~> 0.10.0)
178
- simplecov-html (0.10.1)
179
- slack-notifier (2.2.2)
181
+ simplecov-html (0.10.2)
182
+ slack-notifier (2.3.1)
180
183
  sprockets (3.7.1)
181
184
  concurrent-ruby (~> 1.0)
182
185
  rack (> 1, < 3)
183
- sprockets-rails (3.2.0)
186
+ sprockets-rails (3.2.1)
184
187
  actionpack (>= 4.0)
185
188
  activesupport (>= 4.0)
186
189
  sprockets (>= 3.0.0)
187
190
  sqlite3 (1.3.13)
188
- term-ansicolor (1.6.0)
189
- tins (~> 1.0)
190
- thor (0.19.4)
191
+ term-ansicolor (1.2.2)
192
+ tins (~> 0.8)
193
+ thor (0.18.1)
191
194
  thread_safe (0.3.6)
192
195
  timecop (0.9.1)
193
- tins (1.15.0)
196
+ tins (0.13.2)
194
197
  tzinfo (1.2.3)
195
198
  thread_safe (~> 0.1)
196
199
  uniform_notifier (1.10.0)
@@ -216,12 +219,12 @@ DEPENDENCIES
216
219
  dotenv-rails
217
220
  factory_girl_rails (~> 4.8.0)
218
221
  mongoid (>= 4.0.0)
219
- mysql2 (~> 0.4.8)
222
+ mysql2 (~> 0.4.9)
220
223
  pg (~> 0.21.0)
221
224
  rails (~> 5.1.0)
222
225
  rails-controller-testing
223
- rspec-rails (~> 3.6.0)
224
- simplecov (~> 0.14.1)
226
+ rspec-rails (~> 3.6.1)
227
+ simplecov (~> 0.15.1)
225
228
  slack-notifier (>= 1.5.1)
226
229
  sqlite3 (~> 1.3.13)
227
230
  timecop
@@ -102,7 +102,7 @@ module ActivityNotification
102
102
  # @option options [Object] :filtered_by_group (nil) Group instance for filter
103
103
  # @option options [String] :filtered_by_group_type (nil) Group type for filter, valid with :filtered_by_group_id
104
104
  # @option options [String] :filtered_by_group_id (nil) Group instance id for filter, valid with :filtered_by_group_type
105
- # @option options [String] :filtered_by_key (nil) Key of the notification for filter
105
+ # @option options [String] :filtered_by_key (nil) Key of the notification for filter
106
106
  # @option options [Array|Hash] :custom_filter (nil) Custom notification filter (e.g. ["created_at >= ?", time.hour.ago])
107
107
  # @return [ActiveRecord_AssociationRelation<Notificaion>, Mongoid::Criteria<Notificaion>] Database query of filtered notifications
108
108
  scope :filtered_by_options, ->(options = {}) {
@@ -160,10 +160,11 @@ module ActivityNotification
160
160
  # @option options [Boolean] :send_email (true) Whether it sends notification email
161
161
  # @option options [Boolean] :send_later (true) Whether it sends notification email asynchronously
162
162
  # @option options [Boolean] :publish_optional_targets (true) Whether it publishes notification to optional targets
163
+ # @option options [Boolean] :pass_full_options (false) Whether it passes full options to notifiable.notification_targets, not a key only
163
164
  # @option options [Hash<String, Hash>] :optional_targets ({}) Options for optional targets, keys are optional target name (:amazon_sns or :slack etc) and values are options
164
165
  # @return [Array<Notificaion>] Array of generated notifications
165
166
  def notify(target_type, notifiable, options = {})
166
- targets = notifiable.notification_targets(target_type, options[:key])
167
+ targets = notifiable.notification_targets(target_type, options[:pass_full_options] ? options : options[:key])
167
168
  unless targets.blank?
168
169
  notify_all(targets, notifiable, options)
169
170
  end
@@ -262,7 +263,7 @@ module ActivityNotification
262
263
  target_unopened_notifications.update_all(opened_at: opened_at)
263
264
  unopened_notification_count
264
265
  end
265
-
266
+
266
267
  # Returns if group member of the notifications exists.
267
268
  # This method is designed to be called from controllers or views to avoid N+1.
268
269
  #
@@ -405,7 +406,7 @@ module ActivityNotification
405
406
  def group_member?
406
407
  group_owner_id.present?
407
408
  end
408
-
409
+
409
410
  # Returns if group member of the notification exists.
410
411
  # This method is designed to cache group by query result to avoid N+1 call.
411
412
  #
@@ -64,15 +64,17 @@ module ActivityNotification
64
64
  # This method is able to be overriden.
65
65
  #
66
66
  # @param [String] target_type Target type to notify
67
- # @param [String] key Key of the notification
67
+ # @param [Hash] options Options for notifications
68
+ # @option options [String] :key (notifiable.default_notification_key) Key of the notification
69
+ # @option options [Hash] :parameters ({}) Additional parameters of the notifications
68
70
  # @return [Array<Notificaion> | ActiveRecord_AssociationRelation<Notificaion>] Array or database query of the notification targets
69
- def notification_targets(target_type, key = nil)
71
+ def notification_targets(target_type, options = {})
70
72
  target_typed_method_name = "notification_#{cast_to_resources_name(target_type)}"
71
73
  resolved_parameter = resolve_parameter(
72
74
  target_typed_method_name,
73
75
  _notification_targets[cast_to_resources_sym(target_type)],
74
76
  nil,
75
- key)
77
+ options)
76
78
  unless resolved_parameter
77
79
  raise NotImplementedError, "You have to implement #{self.class}##{target_typed_method_name} "\
78
80
  "or set :targets in acts_as_notifiable"
@@ -25,7 +25,7 @@ module ActivityNotification
25
25
  # Belongs to group instance of this notification as polymorphic association.
26
26
  # @scope instance
27
27
  # @return [Object] Group instance of this notification
28
- belongs_to :group, polymorphic: true
28
+ belongs_to :group, { polymorphic: true }.merge(Rails::VERSION::MAJOR >= 5 ? { optional: true } : {})
29
29
 
30
30
  # Belongs to group owner notification instance of this notification.
31
31
  # Only group member instance has :group_owner value.
@@ -41,10 +41,10 @@ module ActivityNotification
41
41
  # @return [ActiveRecord_AssociationRelation<Notificaion>] Database query of the group member notification instances of this notification
42
42
  has_many :group_members, class_name: "ActivityNotification::Notification", foreign_key: :group_owner_id
43
43
 
44
- # Belongs to :otifier instance of this notification.
44
+ # Belongs to :notifier instance of this notification.
45
45
  # @scope instance
46
46
  # @return [Object] Notifier instance of this notification
47
- belongs_to :notifier, polymorphic: true
47
+ belongs_to :notifier, { polymorphic: true }.merge(Rails::VERSION::MAJOR >= 5 ? { optional: true } : {})
48
48
 
49
49
  # Serialize parameters Hash
50
50
  serialize :parameters, Hash
@@ -1,3 +1,3 @@
1
1
  module ActivityNotification
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
@@ -70,6 +70,35 @@ shared_examples_for :notification_api do
70
70
  expect(ActivityNotification::Mailer.deliveries.last.to[0]).to eq(@author_user.email)
71
71
  end
72
72
  end
73
+
74
+ context "with pass_full_options" do
75
+ context "as false (as default)" do
76
+ it "accepts specified lambda with notifiable and key arguments" do
77
+ Comment._notification_targets[:users] = ->(notifiable, key){ User.all if key == 'dummy_key' }
78
+ described_class.notify(:users, @comment_2, key: 'dummy_key')
79
+ expect(@author_user.notifications.unopened_only.count).to eq(1)
80
+ end
81
+
82
+ it "cannot accept specified lambda with notifiable and options arguments" do
83
+ Comment._notification_targets[:users] = ->(notifiable, options){ User.all if options[:key] == 'dummy_key' }
84
+ expect { described_class.notify(:users, @comment_2, key: 'dummy_key') }.to raise_error(TypeError)
85
+ end
86
+ end
87
+
88
+ context "as true" do
89
+ it "cannot accept specified lambda with notifiable and key arguments" do
90
+ Comment._notification_targets[:users] = ->(notifiable, key){ User.all if key == 'dummy_key' }
91
+ expect { described_class.notify(:users, @comment_2, key: 'dummy_key', pass_full_options: true) }.to raise_error(NotImplementedError)
92
+ end
93
+
94
+ it "accepts specified lambda with notifiable and options arguments" do
95
+ Comment._notification_targets[:users] = ->(notifiable, options){ User.all if options[:key] == 'dummy_key' }
96
+ described_class.notify(:users, @comment_2, key: 'dummy_key', pass_full_options: true)
97
+ expect(@author_user.notifications.unopened_only.count).to eq(1)
98
+ end
99
+ end
100
+ end
101
+
73
102
  end
74
103
 
75
104
  describe ".notify_all" do
@@ -15,16 +15,16 @@ shared_examples_for :notifiable do
15
15
  describe ".set_notifiable_class_defaults" do
16
16
  it "set parameter fields as default" do
17
17
  described_class.set_notifiable_class_defaults
18
- expect(described_class._notification_targets).to eq({})
19
- expect(described_class._notification_group).to eq({})
20
- expect(described_class._notification_group_expiry_delay).to eq({})
21
- expect(described_class._notifier).to eq({})
22
- expect(described_class._notification_parameters).to eq({})
23
- expect(described_class._notification_email_allowed).to eq({})
24
- expect(described_class._notifiable_path).to eq({})
25
- expect(described_class._printable_notifiable_name).to eq({})
26
- end
27
- end
18
+ expect(described_class._notification_targets).to eq({})
19
+ expect(described_class._notification_group).to eq({})
20
+ expect(described_class._notification_group_expiry_delay).to eq({})
21
+ expect(described_class._notifier).to eq({})
22
+ expect(described_class._notification_parameters).to eq({})
23
+ expect(described_class._notification_email_allowed).to eq({})
24
+ expect(described_class._notifiable_path).to eq({})
25
+ expect(described_class._printable_notifiable_name).to eq({})
26
+ end
27
+ end
28
28
  end
29
29
 
30
30
  describe "as public instance methods" do
@@ -42,6 +42,8 @@ shared_examples_for :notifiable do
42
42
  it "raises NotImplementedError" do
43
43
  expect { test_instance.notification_targets(User, 'dummy_key') }
44
44
  .to raise_error(NotImplementedError, /You have to implement .+ or set :targets in acts_as_notifiable/)
45
+ expect { test_instance.notification_targets(User, { key: 'dummy_key' }) }
46
+ .to raise_error(NotImplementedError, /You have to implement .+ or set :targets in acts_as_notifiable/)
45
47
  end
46
48
  end
47
49
 
@@ -54,6 +56,7 @@ shared_examples_for :notifiable do
54
56
  end
55
57
  test_instance.extend(AdditionalMethods)
56
58
  expect(test_instance.notification_targets(User, 'dummy_key')).to eq(User.all)
59
+ expect(test_instance.notification_targets(User, { key: 'dummy_key' })).to eq(User.all)
57
60
  end
58
61
  end
59
62
 
@@ -61,6 +64,7 @@ shared_examples_for :notifiable do
61
64
  it "returns specified value" do
62
65
  described_class._notification_targets[:users] = User.all
63
66
  expect(test_instance.notification_targets(User, 'dummy_key')).to eq(User.all)
67
+ expect(test_instance.notification_targets(User, { key: 'dummy_key' })).to eq(User.all)
64
68
  end
65
69
 
66
70
  it "returns specified symbol without argumentss" do
@@ -72,6 +76,7 @@ shared_examples_for :notifiable do
72
76
  test_instance.extend(AdditionalMethods)
73
77
  described_class._notification_targets[:users] = :custom_notification_users
74
78
  expect(test_instance.notification_targets(User, 'dummy_key')).to eq(User.all)
79
+ expect(test_instance.notification_targets(User, { key: 'dummy_key' })).to eq(User.all)
75
80
  end
76
81
 
77
82
  it "returns specified symbol with key argument" do
@@ -83,17 +88,24 @@ shared_examples_for :notifiable do
83
88
  test_instance.extend(AdditionalMethods)
84
89
  described_class._notification_targets[:users] = :custom_notification_users
85
90
  expect(test_instance.notification_targets(User, 'dummy_key')).to eq(User.all)
91
+ expect(test_instance.notification_targets(User, { key: 'dummy_key' })).to eq(User.all)
86
92
  end
87
93
 
88
94
  it "returns specified lambda with single notifiable argument" do
89
95
  described_class._notification_targets[:users] = ->(notifiable){ User.all }
90
96
  expect(test_instance.notification_targets(User, 'dummy_key')).to eq(User.all)
97
+ expect(test_instance.notification_targets(User, { key: 'dummy_key' })).to eq(User.all)
91
98
  end
92
99
 
93
100
  it "returns specified lambda with notifiable and key arguments" do
94
- described_class._notification_targets[:users] = ->(notifiable, key){ User.all }
101
+ described_class._notification_targets[:users] = ->(notifiable, key){ User.all if key == 'dummy_key' }
95
102
  expect(test_instance.notification_targets(User, 'dummy_key')).to eq(User.all)
96
103
  end
104
+
105
+ it "returns specified lambda with notifiable and options arguments" do
106
+ described_class._notification_targets[:users] = ->(notifiable, options){ User.all if options[:key] == 'dummy_key' }
107
+ expect(test_instance.notification_targets(User, { key: 'dummy_key' })).to eq(User.all)
108
+ end
97
109
  end
98
110
  end
99
111
 
@@ -186,7 +186,7 @@ describe ActivityNotification::ActsAsNotifiable do
186
186
  @notifiable_1, @notifiable_2, @notifiable_3 = dummy_notifiable_class.create, dummy_notifiable_class.create, dummy_notifiable_class.create
187
187
  @group_owner = create(:notification, target: user_target, notifiable: @notifiable_1, group: @notifiable_1)
188
188
  @group_member = create(:notification, target: user_target, notifiable: @notifiable_2, group: @notifiable_1, group_owner: @group_owner)
189
- create(:notification, target: user_target, notifiable: @notifiable_3, group: @notifiable_1, group_owner: @group_owner)
189
+ create(:notification, target: user_target, notifiable: @notifiable_3, group: @notifiable_1, group_owner: @group_owner, created_at: @group_member.created_at + 10.second)
190
190
  @other_target_group_owner = create(:notification, target: dummy_target, notifiable: @notifiable_1, group: @notifiable_1)
191
191
  @other_target_group_member = create(:notification, target: dummy_target, notifiable: @notifiable_2, group: @notifiable_1, group_owner: @other_target_group_owner)
192
192
  create(:notification, target: dummy_target, notifiable: @notifiable_3, group: @notifiable_1, group_owner: @other_target_group_owner)
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: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Yamazaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-22 00:00:00.000000000 Z
11
+ date: 2017-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 0.4.8
81
+ version: 0.4.9
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.4.8
88
+ version: 0.4.9
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: pg
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: 3.6.0
123
+ version: 3.6.1
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: 3.6.0
130
+ version: 3.6.1
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: factory_girl_rails
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 0.14.1
151
+ version: 0.15.1
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 0.14.1
158
+ version: 0.15.1
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: yard
161
161
  requirement: !ruby/object:Gem::Requirement