simple_notifications 1.1.8 → 1.1.9

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: ac34511b2c3da57df59fcf6a5d31d4a3e108d45a93b56d78acae05b032303311
4
- data.tar.gz: 3daf3195e073ed5117b8bda4f5cc14fa00b404b68934fbb7ff7348bea357c308
3
+ metadata.gz: 734d3ac28915b2e74210cc06566ddeed980696f65f36300cc63925a684a56ca5
4
+ data.tar.gz: 739123957632324deb2cffe1d8edc9bff3826af6946fbd981b3b60e757d449ab
5
5
  SHA512:
6
- metadata.gz: 4571f8e0080aa3592c5c30a22b09fe6a0f3d4336144268616bd3b922e6ecec64ffa3b71049628ac5faa6ee35c286876e7295aebe0f732a467d72f42c006a8360
7
- data.tar.gz: eef1b1bbe353c76239379b739c73763b794c455e0388a10d233961a081a8a69b68870eede03f0bbdc39bd6995ee7ad2c349e6e26e92dcd5cd46a8944c2be09c8
6
+ metadata.gz: a366d2e14de8e59c6456e4d3827b846cde3485c21d062ba30db017b16661e33986962f06eef1540f19014b65da0c24b2d6b5749ffaf4246d4b0920e4518e120c
7
+ data.tar.gz: e190dcf5be3dd5b4f567f6ab3c0e41dee297938aa64cc5227a295dd49214a098c24d18791ba0fe4f3ec3bdb2eaef7cf50ad41237138f80f6cb121f404c317ab6
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Simple Notifications
2
2
 
3
3
  A very simple gem providing the notifications functionality to any model in a Rails application.
4
+ It does not provide the push notifications.
5
+
6
+ It creates all the models/migrations/associations/callbacks for you.
4
7
 
5
8
  ### Installation
6
9
 
@@ -20,46 +23,47 @@ Or install it yourself as:
20
23
 
21
24
  ### Usage
22
25
 
23
- Run the simple notifications generator
26
+ * First run the simple notifications generator to generate two files in your rails project
27
+
28
+ * simple_notifications.rb - An initializer file.
29
+ * Migration files - Required for recording notifications.
24
30
 
25
31
  ```ruby
26
32
  rails generate simple_notifications:install
27
33
  ```
28
- This will generate two files in your rails project
29
-
30
- * simple_notifications.rb - An initializer file.
31
- * Migration files - Required for recording notifications.
32
34
 
33
- Then run
35
+ * Migrate Database
34
36
 
35
37
  ```ruby
36
38
  rails db:migrate
37
39
  ```
38
40
 
39
- Add following line to the model for which notifications functionality is required. Here [Post] is the model which is the base for notification to happen i.e Event is performed on Post.
41
+ Add the following line to the model for which notifications functionality is required.
42
+ Here [Post] is the model which is the base for notification to happen i.e Event is performed on Post.
40
43
 
41
44
  ```ruby
42
- notify sender: :author,
43
- receivers: :followers,
44
- actions: [:follow, :unfollow, :update, :create, :destroy],
45
- notify_message: :message_method,
46
- before_notify: :before_notify_method,
47
- after_notify: :after_notify_method,
48
- before_delivered: :before_delivered_method,
49
- after_delivered: :after_delivered_method,
50
- before_read: :before_read_method,
51
- after_read: :after_read_method
45
+ acts_as_notifier sender: :author,
46
+ receivers: :followers,
47
+ actions: [:follow, :unfollow, :update, :create, :destroy],
48
+ notify_message: :message_method,
49
+ before_notify: :before_notify_method,
50
+ after_notify: :after_notify_method,
51
+ before_delivered: :before_delivered_method,
52
+ after_delivered: :after_delivered_method,
53
+ before_read: :before_read_method,
54
+ after_read: :after_read_method
52
55
  ```
53
56
  Here [receivers] will be notified that an event was done by [sender] on [post] entity with a message that is configurable.
54
57
 
55
58
  You can also provide ActiveRecord::Base object or ActiveRecord::Relation objects as
56
59
 
57
60
  ```ruby
58
- notify sender: :author, receivers: User.all
59
- notify sender: User.first, receivers: [:followers, User.all]
61
+ acts_as_notifier sender: :author, receivers: User.all, actions: [:create]
62
+ acts_as_notifier sender: User.first, receivers: [:followers, User.all], actions: [:create]
60
63
  ```
61
64
 
62
- Here [:sender] is the [belongs_to] association with [:post] while :followers is the [:has_many] associations for the [:post] model through [:sender] model which needs to be notified.
65
+ Here [:sender] is the [belongs_to] association with [:post] while :followers is the [:has_many] associations for the
66
+ [:post] model through [:sender] model which needs to be notified.
63
67
 
64
68
  ### Notification Models
65
69
 
@@ -67,7 +71,8 @@ Here [:sender] is the [belongs_to] association with [:post] while :followers is
67
71
  SimpleNotifications::Record
68
72
  SimpleNotifications::Delivery
69
73
  ```
70
- Here assumption is that one event performed by [:sender] on entity [:post] will have one type of notification and it needs to be delivered to many [:receivers].
74
+ Here assumption is that one event performed by [:sender] on entity [:post] will have one type of notification
75
+ and it needs to be delivered to many [:receivers].
71
76
 
72
77
  ### Scopes
73
78
 
@@ -1,3 +1,3 @@
1
1
  module SimpleNotifications
2
- VERSION = '1.1.8'
2
+ VERSION = '1.1.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ashish Garg