acts_as_realtime 0.0.5 → 0.0.6
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 +8 -8
- data/lib/acts_as_realtime.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmMxNjU2MmU1YzllZTE1Mzk4YjA1M2FlNWRiMmUxMDliZWJiMWM4YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTM4YWVkY2Q3MzIzMTMzYzgzNmQ3YjY4YTFkMjE4YTNlNWRkNTJjMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzY5NTc1YmZiMjQ1MjhhMTFlMThhMWJmNmZkMGEwMDBmNjkzMDEwMGVhMmJj
|
10
|
+
ZmZjZjFlYzljMTY1MDdlM2MzYWNmOTVkOTE5YWQ2NWJhOTI3OTdkYzlhYTk4
|
11
|
+
OGIyYTUxNDU0ZDc5M2VhYjllNjhjNmMxNGVhMzAxYTFlYzljOTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjA4MzJkMjYwMDJiMjJjMDIwYWEzNmJkNGVmYjJkZDYxMTU2NjBlZGI2MGUx
|
14
|
+
ZjNiYzllMjgyOGM5ZTc3NGI0NjdiZGQ1ZGY3ODhhNzZhZWQyNzIwMTA3NzZj
|
15
|
+
NTA1NDRjYjI3NDFkMWQyYTBhZDk4MGE4NGJlODRjOGRiYWVjNjA=
|
data/lib/acts_as_realtime.rb
CHANGED
@@ -49,7 +49,7 @@ module ActsAsRealTime
|
|
49
49
|
|
50
50
|
module ClassMethods
|
51
51
|
|
52
|
-
def acts_as_realtime(
|
52
|
+
def acts_as_realtime(modelo, selector, insertion_method = 'prepend', &blk)
|
53
53
|
|
54
54
|
=begin
|
55
55
|
Se había manejado cómo posible solución el manejar un token(*-*)
|
@@ -76,7 +76,7 @@ module ActsAsRealTime
|
|
76
76
|
=end
|
77
77
|
|
78
78
|
#Se define el método update_index en lo modelos que se ejecute el método acts_as_real_time
|
79
|
-
|
79
|
+
modelo.class_eval {
|
80
80
|
define_method(:update_index) do
|
81
81
|
|
82
82
|
#eval("html[start_index..finish_index] = #{attr}") Esta instrucción se usaba para la solución que se planteó arriba
|
@@ -84,7 +84,7 @@ module ActsAsRealTime
|
|
84
84
|
res_yield = yield ActsAsRealTime.ws, ActsAsRealTime.channel, self if block_given?
|
85
85
|
ActsAsRealTime.mod_app, ActsAsRealTime.html = res_yield[0], res_yield[1]
|
86
86
|
ActsAsRealTime.mod_app::Application.config.chanel = ActsAsRealTime::channel
|
87
|
-
ActsAsRealTime.mod_app::Application.config.chanel.push "$('#{
|
87
|
+
ActsAsRealTime.mod_app::Application.config.chanel.push "$('#{selector}').#{insertion_method}('#{ActsAsRealTime.html}');"
|
88
88
|
end
|
89
89
|
after_create :update_index
|
90
90
|
}
|