noticed 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -1
- data/app/jobs/noticed/event_job.rb +1 -3
- data/app/models/noticed/ephemeral.rb +1 -0
- data/lib/noticed/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 677a6b78d1143ff969b760036c8e65f0bce31634d5c7266dcc349d578d95fca9
|
4
|
+
data.tar.gz: d4324a075d591bce40142e00238e7569204ff992f873751d87996ea58c9c5dea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f67c84d09542ac5aead58374c887cb7819e4d51764789a58236a942b820d10df87576a24ed643f2ec93d8df511f7d5cffe8587232248a22c0d7dfdf2cc998206
|
7
|
+
data.tar.gz: 47a50d36007c73123e198fcb3b12e14765a5939d6f987a2394a78428d3f50ffaab56a33bb2da67436885e92a8cf86242d7c956e7482b1aef892b00c9ec972aa6
|
data/README.md
CHANGED
@@ -341,7 +341,7 @@ If you want to reuse delivery method configurations across multiple Notifiers, y
|
|
341
341
|
# /app/notifiers/notifiers/comment_notifier.rb
|
342
342
|
class CommentNotifier < Noticed::Event
|
343
343
|
include IosNotifier
|
344
|
-
include
|
344
|
+
include AndroidNotifier
|
345
345
|
include EmailNotifier
|
346
346
|
|
347
347
|
validates :record, presence: true
|
@@ -399,6 +399,34 @@ This invocation will create a single `Noticed::Event` record and a `Noticed::Not
|
|
399
399
|
- An individual delivery job for `:email` method to the second thread author
|
400
400
|
- Etc...
|
401
401
|
|
402
|
+
#### Tip: Define recipients inside the notifier
|
403
|
+
|
404
|
+
Recipients can also be computed inside a notifier:
|
405
|
+
|
406
|
+
```ruby
|
407
|
+
class NewCommentNotifier < ApplicationNotifier
|
408
|
+
recipients ->{ params[:record].thread.all_authors }
|
409
|
+
|
410
|
+
# or
|
411
|
+
recipients do
|
412
|
+
params[:record].thread.all_authors
|
413
|
+
end
|
414
|
+
|
415
|
+
# or
|
416
|
+
recipients :fetch_recipients
|
417
|
+
|
418
|
+
def fetch_recipients
|
419
|
+
# ...
|
420
|
+
end
|
421
|
+
end
|
422
|
+
```
|
423
|
+
|
424
|
+
This makes the code for sending a notification neater:
|
425
|
+
|
426
|
+
```ruby
|
427
|
+
NewCommentNotifier.with(record: @comment, foo: "bar").deliver
|
428
|
+
```
|
429
|
+
|
402
430
|
### Custom Noticed Model Methods
|
403
431
|
|
404
432
|
In order to extend the Noticed models you'll need to use a concern and a to_prepare block:
|
data/lib/noticed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noticed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.5.
|
103
|
+
rubygems_version: 3.5.17
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Notifications for Ruby on Rails applications
|