y-rb_actioncable 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c1bd91dd64aefce65bac62b72f51bf0441e222fb5c865a45a3257addbc5f4dd
4
- data.tar.gz: 48074bedce935ac2adabf6d4f34942bb1c2ba1f08e1d278c3004b508f1b0eedf
3
+ metadata.gz: 6f06116e8fced707775ecdbc580d8b46b7ae6f0a0e2e55042b94785da6765516
4
+ data.tar.gz: e6a8acf34ac91161f2b270459a9155bafeed09398c578d08c344051ee173573a
5
5
  SHA512:
6
- metadata.gz: 7ecaf95ff7925f08a035e54f41290fb939f6ae40666af50d736771df103aa14b988b84cd08bbfbfa006320eac72d63f573d3afa1f172f51abcbf28c6b2a06a6c
7
- data.tar.gz: 3a734d0f445edfc492901efe1219e72d39b9321e5e00fbe8f56a248882ff6822ab276d294dd219570d51dde8a14ee3f4baf6cb401db7adcd1790eaa4764ca0e6
6
+ metadata.gz: bb45227353a4f55e880908a59abf2ca9e8afd1f61eb011eed431bc4a64db4acae033bea610b230691134eceaa981015a6fddac7ba34e83eaaf20f64065431092
7
+ data.tar.gz: b35bfce523b71dd05af4f714707e5a13623b95332021dbab705b4bd27703e747324bbfd7051ccdea868415f7048cc6c87c62db1779c09bb04272d83a88dac9eb
@@ -87,7 +87,10 @@ module Y
87
87
 
88
88
  # do not transmit message back to current connection if the connection
89
89
  # is the origin of the message
90
- transmit(message) if origin != connection.connection_identifier
90
+ connection_identifier = connection.connection_identifier
91
+ return if connection_identifier.present? && origin == connection_identifier
92
+
93
+ transmit(message)
91
94
  end
92
95
 
93
96
  # Sync for given model. This is a utility method that simplifies the setup
@@ -150,7 +153,7 @@ module Y
150
153
  # we broadcast to all connected clients, but provide the
151
154
  # connection_identifier as origin so that the [#integrate] method is
152
155
  # able to filter sending back the update to its origin.
153
- self.class.broadcast(
156
+ ActionCable.server.broadcast(
154
157
  broadcasting,
155
158
  { update: update, origin: connection.connection_identifier }
156
159
  )
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Y
4
4
  module Actioncable
5
- VERSION = "0.1.3"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: y-rb_actioncable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannes Moser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-31 00:00:00.000000000 Z
11
+ date: 2023-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails