render_turbo_stream 4.3.15 → 4.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/render_turbo_stream/channel_view_helpers.rb +2 -2
- data/lib/render_turbo_stream/controller_channel_helpers.rb +9 -9
- data/lib/render_turbo_stream/controller_helpers.rb +1 -1
- data/lib/render_turbo_stream/libs.rb +4 -0
- data/lib/render_turbo_stream/test/request/channel_helpers.rb +4 -4
- data/lib/render_turbo_stream/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91ec62a537df4902f5adcf7caf65a6b6a098365d2c983cda574a2d9ab1ffd22e
|
4
|
+
data.tar.gz: 28b80ad8d49000bc97b8b4fb0d66e1810befd61f0812aeb00712f8836d2dca3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 343b599092acb9ccb1dc2f046175af02a6771696f0883f573b9f5f99e3891ff86fe6064510e761a05deba57feb814d0a473da61f8842eea0ea4642fc16d33996
|
7
|
+
data.tar.gz: ea135fc6460784cf9a2a7c5f738fe37e639e23645577b53b5e761443ca20bca141167eb6d68a8adcf466b7f90e4c4caea8aef55ba4838c3f29b9231670fd7139
|
@@ -3,7 +3,7 @@ module RenderTurboStream
|
|
3
3
|
|
4
4
|
def channel_from_me
|
5
5
|
if current_user
|
6
|
-
turbo_stream_from "
|
6
|
+
turbo_stream_from "authenticated_user_#{current_user.id}"
|
7
7
|
else
|
8
8
|
Rails.logger.debug(" • SKIP channel_from_me because not authenticated")
|
9
9
|
nil
|
@@ -12,7 +12,7 @@ module RenderTurboStream
|
|
12
12
|
|
13
13
|
def channel_from_authenticated_group(group)
|
14
14
|
if current_user
|
15
|
-
turbo_stream_from "
|
15
|
+
turbo_stream_from "authenticated_group_#{group}"
|
16
16
|
else
|
17
17
|
Rails.logger.debug(" • SKIP channel_from_authenticated_group because not authenticated")
|
18
18
|
nil
|
@@ -2,7 +2,7 @@ module RenderTurboStream
|
|
2
2
|
module ControllerChannelHelpers
|
3
3
|
|
4
4
|
def render_to_all(target_id = nil, action = :replace, partial: nil, template: nil, locals: nil)
|
5
|
-
evaluate_instance_variables
|
5
|
+
#evaluate_instance_variables
|
6
6
|
render_to_channel(
|
7
7
|
'all',
|
8
8
|
target_id,
|
@@ -26,8 +26,8 @@ module RenderTurboStream
|
|
26
26
|
end
|
27
27
|
|
28
28
|
render_to_channel(
|
29
|
-
"
|
30
|
-
|
29
|
+
"authenticated_user_#{helpers.current_user.id}",
|
30
|
+
target_id,
|
31
31
|
action,
|
32
32
|
partial: partial,
|
33
33
|
locals: locals
|
@@ -47,8 +47,8 @@ module RenderTurboStream
|
|
47
47
|
end
|
48
48
|
|
49
49
|
render_to_channel(
|
50
|
-
"
|
51
|
-
|
50
|
+
"authenticated_group_#{group}",
|
51
|
+
target_id,
|
52
52
|
action,
|
53
53
|
partial: partial,
|
54
54
|
locals: locals
|
@@ -76,7 +76,7 @@ module RenderTurboStream
|
|
76
76
|
@render_cable_template_was_called = true
|
77
77
|
end
|
78
78
|
|
79
|
-
evaluate_instance_variables
|
79
|
+
#evaluate_instance_variables
|
80
80
|
|
81
81
|
libs = RenderTurboStream::ChannelLibs.new(response)
|
82
82
|
libs.render_to_channel(
|
@@ -107,7 +107,7 @@ module RenderTurboStream
|
|
107
107
|
return
|
108
108
|
end
|
109
109
|
|
110
|
-
action_to_channel("
|
110
|
+
action_to_channel("authenticated_user_#{helpers.current_user.id}", action, arguments)
|
111
111
|
end
|
112
112
|
|
113
113
|
def action_to_authenticated_group(group, action, *arguments)
|
@@ -123,7 +123,7 @@ module RenderTurboStream
|
|
123
123
|
return
|
124
124
|
end
|
125
125
|
|
126
|
-
action_to_channel("
|
126
|
+
action_to_channel("authenticated_group_#{group}", action, arguments)
|
127
127
|
end
|
128
128
|
|
129
129
|
def action_to_channel(channel, command, arguments)
|
@@ -202,7 +202,7 @@ module RenderTurboStream
|
|
202
202
|
libs = RenderTurboStream::ChannelLibs.new(response)
|
203
203
|
if (helpers.current_user.id rescue false)
|
204
204
|
libs.send_actions_to_channel(
|
205
|
-
"
|
205
|
+
"authenticated_user_#{helpers.current_user.id}",
|
206
206
|
turbo_actions,
|
207
207
|
instance_variables: instance_variables
|
208
208
|
)
|
@@ -111,7 +111,7 @@ module RenderTurboStream
|
|
111
111
|
if allow_channel
|
112
112
|
Rails.logger.debug(" • Send actions through Turbo::StreamsChannel")
|
113
113
|
c_libs = RenderTurboStream::ChannelLibs.new(response)
|
114
|
-
c_libs.send_actions_to_channel("
|
114
|
+
c_libs.send_actions_to_channel("authenticated_user_#{helpers.current_user.id}", streams, @render_turbo_stream_evaluate_instance_variables)
|
115
115
|
else
|
116
116
|
flash[:alert] = flashes[:alerts]
|
117
117
|
flash[:notice] = flashes[:notices]
|
@@ -7,7 +7,7 @@ module RenderTurboStream
|
|
7
7
|
|
8
8
|
def assert_channel_to_me(user, target_id, action: nil, count: 1, &block)
|
9
9
|
|
10
|
-
channel = "
|
10
|
+
channel = "authenticated_user_#{user.id}"
|
11
11
|
|
12
12
|
libs = RenderTurboStream::Test::Request::Libs.new(response)
|
13
13
|
|
@@ -21,7 +21,7 @@ module RenderTurboStream
|
|
21
21
|
|
22
22
|
def assert_action_to_me(user, action, count: 1, &block)
|
23
23
|
|
24
|
-
channel = "
|
24
|
+
channel = "authenticated_user_#{user.id}"
|
25
25
|
|
26
26
|
libs = RenderTurboStream::Test::Request::Libs.new(response)
|
27
27
|
|
@@ -37,7 +37,7 @@ module RenderTurboStream
|
|
37
37
|
|
38
38
|
def assert_channel_to_authenticated_group(group, target_id, count: 1, &block)
|
39
39
|
|
40
|
-
channel = "
|
40
|
+
channel = "authenticated_group_#{group}"
|
41
41
|
|
42
42
|
libs = RenderTurboStream::Test::Request::Libs.new(response)
|
43
43
|
|
@@ -51,7 +51,7 @@ module RenderTurboStream
|
|
51
51
|
|
52
52
|
def assert_action_to_authenticated_group(group, action, count: 1, &block)
|
53
53
|
|
54
|
-
channel = "
|
54
|
+
channel = "authenticated_group_#{group}"
|
55
55
|
|
56
56
|
libs = RenderTurboStream::Test::Request::Libs.new(response)
|
57
57
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_turbo_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- christian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|