turbo-rails 2.0.13 → 2.0.16
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 +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/turbo.js +5 -5
- data/app/assets/javascripts/turbo.min.js +1 -1
- data/app/assets/javascripts/turbo.min.js.map +1 -1
- data/app/channels/turbo/streams/broadcasts.rb +3 -1
- data/app/models/concerns/turbo/broadcastable.rb +2 -2
- data/app/views/layouts/turbo_rails/frame.html.erb +1 -0
- data/lib/turbo/version.rb +1 -1
- metadata +2 -2
@@ -68,8 +68,10 @@ module Turbo::Streams::Broadcasts
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def broadcast_refresh_later_to(*streamables, request_id: Turbo.current_request_id, **opts)
|
71
|
+
stream_name = stream_name_from(streamables)
|
72
|
+
|
71
73
|
refresh_debouncer_for(*streamables, request_id: request_id).debounce do
|
72
|
-
Turbo::Streams::BroadcastStreamJob.perform_later
|
74
|
+
Turbo::Streams::BroadcastStreamJob.perform_later stream_name, content: turbo_stream_refresh_tag(request_id: request_id, **opts).to_str # Sidekiq requires job arguments to be valid JSON types, such as String
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
@@ -286,7 +286,7 @@ module Turbo::Broadcastable
|
|
286
286
|
#
|
287
287
|
# # sends <turbo-stream action="update" method="morph" target="clearance_5"><template><div id="clearance_5">Other partial</div></template></turbo-stream>
|
288
288
|
# # to the stream named "identity:2:clearances"
|
289
|
-
#
|
289
|
+
# clearance.broadcast_update_to examiner.identity, :clearances, attributes: { method: :morph }, partial: "clearances/other_partial", locals: { a: 1 }
|
290
290
|
def broadcast_update_to(*streamables, **rendering)
|
291
291
|
Turbo::StreamsChannel.broadcast_update_to(*streamables, **extract_options_and_add_target(rendering, target: self)) unless suppressed_turbo_broadcasts?
|
292
292
|
end
|
@@ -518,7 +518,7 @@ module Turbo::Broadcastable
|
|
518
518
|
options.tap do |o|
|
519
519
|
# Add the current instance into the locals with the element name (which is the un-namespaced name)
|
520
520
|
# as the key. This parallels how the ActionView::ObjectRenderer would create a local variable.
|
521
|
-
o[:locals] = (o[:locals] || {}).reverse_merge
|
521
|
+
o[:locals] = (o[:locals] || {}).reverse_merge(model_name.element.to_sym => self).compact
|
522
522
|
|
523
523
|
if o[:html] || o[:partial]
|
524
524
|
return o
|
data/lib/turbo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-06-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|