action_cable_notifications 0.1.6 → 0.1.7
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c8e7ba114ebff5d2eca6ceba782d0042520d217
|
|
4
|
+
data.tar.gz: 55dc2f2c8487a35e4badb789778a98ca2b8415bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4bf60c8c5c3cf4c349149975e1f80106546ed76cbcd915adf72757c3276ecf7e8f76aa85cba2c062e5629661d8a953839b0ac1a0bc9e51811340bda6f45addc0
|
|
7
|
+
data.tar.gz: 21bca2c64cb4ef8c83c257aac7fe873c391c607e7baebc806a267a65e1c77cff7a267ced3f90c186936aeaff730f492f6bce360ab1676b966ca0b3493fcb854b
|
|
@@ -22,17 +22,13 @@ module ActionCableNotifications
|
|
|
22
22
|
# @param [hash] options Hash containing notification options
|
|
23
23
|
#
|
|
24
24
|
def broadcast_notifications_from ( broadcasting, options = nil )
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}.merge(options)
|
|
25
|
+
# Default options
|
|
26
|
+
options = {
|
|
27
|
+
actions: [:create, :update, :destroy],
|
|
28
|
+
scope: :all # Default collection scope
|
|
29
|
+
}.merge(options)
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
else
|
|
34
|
-
self.ActionCableNotificationsOptions.except! broadcasting.to_sym
|
|
35
|
-
end
|
|
31
|
+
self.ActionCableNotificationsOptions[broadcasting.to_s] = options
|
|
36
32
|
end
|
|
37
33
|
|
|
38
34
|
#
|
|
@@ -59,7 +55,7 @@ module ActionCableNotifications
|
|
|
59
55
|
# data: self.scoped_collection(options[:scope])
|
|
60
56
|
# }
|
|
61
57
|
def notify_initial ( broadcasting )
|
|
62
|
-
options = self.ActionCableNotificationsOptions[broadcasting.
|
|
58
|
+
options = self.ActionCableNotificationsOptions[broadcasting.to_s]
|
|
63
59
|
if options.present?
|
|
64
60
|
{
|
|
65
61
|
collection: self.model_name.collection,
|