action_cable_notifications 0.1.35 → 0.1.40
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2923e2f8595fe0b55bbfa3c6fb74650f846127e9377e3a90ec25b1b6a5da5a3a
|
4
|
+
data.tar.gz: 715806de84f8fea2071933de9492380aabcd8e58e59433c9e98a8eeeae6786f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865be42888f685d6f409dba9e5e3de2e37f76bf41db5b3c95916557a188adc87cfb8649d2b98c3ffe376ef0063cc068ebbabbcd4ce043cf6bcae76375e2206fa
|
7
|
+
data.tar.gz: e760653d77c84e11ddaa8a697c7a6748edad25d8357c91ac7fd827b0a797a0bbdf585358b9e9bef0bcc7c7c9e9111f96c4e991e1f0a02719e387240e758e53e2
|
@@ -89,9 +89,11 @@ module ActionCableNotifications
|
|
89
89
|
|
90
90
|
if options[:scope]==:all or record_within_scope(records)
|
91
91
|
ActionCable.server.broadcast publication,
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
{
|
93
|
+
msg: 'create',
|
94
|
+
id: self.id,
|
95
|
+
data: self
|
96
|
+
}
|
95
97
|
end
|
96
98
|
end
|
97
99
|
end
|
@@ -158,20 +160,26 @@ module ActionCableNotifications
|
|
158
160
|
|
159
161
|
if !changes.empty?
|
160
162
|
ActionCable.server.broadcast publication,
|
161
|
-
|
162
|
-
|
163
|
-
|
163
|
+
{
|
164
|
+
msg: 'update',
|
165
|
+
id: self.id,
|
166
|
+
data: changes
|
167
|
+
}
|
164
168
|
end
|
165
169
|
else
|
166
170
|
ActionCable.server.broadcast publication,
|
167
|
-
|
168
|
-
|
169
|
-
|
171
|
+
{
|
172
|
+
msg: 'create',
|
173
|
+
id: record.id,
|
174
|
+
data: record
|
175
|
+
}
|
170
176
|
end
|
171
177
|
elsif was_in_scope # checks if needs to delete the record if its no longer in scope
|
172
178
|
ActionCable.server.broadcast publication,
|
173
|
-
|
174
|
-
|
179
|
+
{
|
180
|
+
msg: 'destroy',
|
181
|
+
id: self.id
|
182
|
+
}
|
175
183
|
end
|
176
184
|
end
|
177
185
|
end
|
@@ -187,8 +195,10 @@ module ActionCableNotifications
|
|
187
195
|
# Checks if record is within scope before broadcasting
|
188
196
|
if options[:scope]==:all or record_within_scope(self.class.scoped_collection(options[:scope])).present?
|
189
197
|
ActionCable.server.broadcast publication,
|
190
|
-
|
191
|
-
|
198
|
+
{
|
199
|
+
msg: 'destroy',
|
200
|
+
id: self.id
|
201
|
+
}
|
192
202
|
end
|
193
203
|
end
|
194
204
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_cable_notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ByS Sistemas de Control
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.3.7
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Automatic realtime notification broadcast for ActiveRecord models changes
|