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: 791d0cda5f750319e778b0f7e0c9c656721d4ad4a3b2dcc6bf7377a88e7d10d8
4
- data.tar.gz: '085b106ff16bde873da19f9c0d800cb5dfcdb184c4bf6607c60872d156fdf0a2'
3
+ metadata.gz: 2923e2f8595fe0b55bbfa3c6fb74650f846127e9377e3a90ec25b1b6a5da5a3a
4
+ data.tar.gz: 715806de84f8fea2071933de9492380aabcd8e58e59433c9e98a8eeeae6786f1
5
5
  SHA512:
6
- metadata.gz: 0d4270f9e8441719683eda7d7874b8f984c108999bcefa5ecf3df371a753c4172f53ea91ba441aa8147cf530126aeef5677d1168b675cd40a8e18e37ec1bcc66
7
- data.tar.gz: 8f4c6acbecb415cd2e9f018ccc0fc17d1187a99ddd9cb77b00fe9aa5645378d693bda60a666707e21c5c6a3e538d5b4752d4f25df2f451b5663d7a5b07f13188
6
+ metadata.gz: 865be42888f685d6f409dba9e5e3de2e37f76bf41db5b3c95916557a188adc87cfb8649d2b98c3ffe376ef0063cc068ebbabbcd4ce043cf6bcae76375e2206fa
7
+ data.tar.gz: e760653d77c84e11ddaa8a697c7a6748edad25d8357c91ac7fd827b0a797a0bbdf585358b9e9bef0bcc7c7c9e9111f96c4e991e1f0a02719e387240e758e53e2
@@ -98,7 +98,7 @@ module ActionCableNotifications
98
98
 
99
99
  if record.present?
100
100
  begin
101
- record.update_attributes(params[:fields])
101
+ record.update(params[:fields])
102
102
  rescue Exception => e
103
103
  error = e.message
104
104
  end
@@ -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
- msg: 'create',
93
- id: self.id,
94
- data: self
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
- msg: 'update',
162
- id: self.id,
163
- data: changes
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
- msg: 'create',
168
- id: record.id,
169
- data: record
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
- msg: 'destroy',
174
- id: self.id
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
- msg: 'destroy',
191
- id: self.id
198
+ {
199
+ msg: 'destroy',
200
+ id: self.id
201
+ }
192
202
  end
193
203
  end
194
204
  end
@@ -1,3 +1,3 @@
1
1
  module ActionCableNotifications
2
- VERSION = '0.1.35'
2
+ VERSION = '0.1.40'
3
3
  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.35
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-05-26 00:00:00.000000000 Z
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.0.8
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