material_raingular-websocket 0.0.2.1.alpha → 0.0.2.2.alpha

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: dfd037fd6b47347d5d9174f8a6bf50aa57d3d260
4
- data.tar.gz: cdd9dcacbb089770552450143d5845f1d1a0ad8a
3
+ metadata.gz: 69ba54fe8a1a6dc711f2f3e578b5e7b7031ebf38
4
+ data.tar.gz: fa54620b45359a06a3addc0405e2c7734a1576ee
5
5
  SHA512:
6
- metadata.gz: c76b1ce4c88b55da645c9404dd6a8afa83d6339dbeffdfe3bb9914ed8a27221d00d1a9cb5de3890cbb6c381223d663dbc694e64fee17cda9a983c3686570eac8
7
- data.tar.gz: 063c3bbe662fc9c4e9331dfa3b0ce32b41285db115fbe918902c0c11bb98c5ca60cde9a7790f8c736c25d158c0303ef19be30692a0ad063fc834bdf1215d3098
6
+ metadata.gz: 46cc861b4dcef33703393c1ffdd3db9376066cf823efebc8f5b63f856d5505b51777422756a1a96350443b06fcc38c80a56272aed80264243799fb0653768ae4
7
+ data.tar.gz: 8a93d92321041ee62703ae0ac3a3412ead856c34f11e796e5d86f32c347e903b32eb269783f89833f20e1625c37f5c60f95f67864697d077d46b21a869984b4d
@@ -36,9 +36,11 @@ angular.module('WebSocket', [])
36
36
  if newVal
37
37
  contentLoaded()
38
38
  parent = scope.$eval(parent_name)
39
- channel = angular.dispatcher.subscribe parent_name + '_' + parent.id
40
- channel.bind 'change', (data) ->
41
- scope.$apply ->
42
- new DateParser(data).to_s()
43
- array_process(data) if attributes.webSocket == 'array'
44
- singleton_process(data) unless attributes.webSocket == 'array'
39
+ angular.channels = {} unless angular.channels
40
+ angular.channels[parent_name] = angular.dispatcher.subscribe parent_name
41
+ angular.channels[parent_name].bind 'change', (data) ->
42
+ if data.id == parent.id
43
+ scope.$apply ->
44
+ new DateParser(data).to_s()
45
+ array_process(data) if attributes.webSocket == 'array'
46
+ singleton_process(data) unless attributes.webSocket == 'array'
@@ -9,7 +9,7 @@ module EmittableExtension
9
9
  after_save :emit_changes
10
10
  define_method(:emit_changes) {WebsocketRails[websocket_namespace].trigger(:change, websocket_message) if WebsocketRails[websocket_namespace].subscribers.present?}
11
11
  define_method(:websocket_message) {self.as_json}
12
- define_method(:websocket_namespace) {"#{self.class.name.underscore}_#{self.id}".to_sym}
12
+ define_method(:websocket_namespace) {self.class.name.underscore.to_sym}
13
13
  end
14
14
  def emittable?() @emittable || false end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  module MaterialRaingular
2
2
  module Websocket
3
- VERSION = "0.0.2.1.alpha"
3
+ VERSION = "0.0.2.2.alpha"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_raingular-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.1.alpha
4
+ version: 0.0.2.2.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2015-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails