turbo-rails 2.0.0.pre.beta.1 → 2.0.0.pre.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/turbo.js +119 -60
- data/app/assets/javascripts/turbo.min.js +6 -6
- data/app/assets/javascripts/turbo.min.js.map +1 -1
- data/app/javascript/turbo/index.js +2 -0
- data/app/jobs/turbo/streams/broadcast_job.rb +1 -1
- data/app/models/concerns/turbo/broadcastable.rb +5 -3
- data/lib/turbo/version.rb +1 -1
- data/lib/turbo-rails.rb +1 -0
- metadata +2 -2
@@ -142,9 +142,11 @@ module Turbo::Broadcastable
|
|
142
142
|
end
|
143
143
|
|
144
144
|
# Same as <tt>#broadcasts_refreshes_to</tt>, but the designated stream for page refreshes is automatically set to
|
145
|
-
# the current model
|
146
|
-
def broadcasts_refreshes
|
147
|
-
|
145
|
+
# the current model, for creates - to the model plural name, which can be overriden by passing <tt>stream</tt>.
|
146
|
+
def broadcasts_refreshes(stream = model_name.plural)
|
147
|
+
after_create_commit -> { broadcast_refresh_later_to(stream) }
|
148
|
+
after_update_commit -> { broadcast_refresh_later }
|
149
|
+
after_destroy_commit -> { broadcast_refresh }
|
148
150
|
end
|
149
151
|
|
150
152
|
# All default targets will use the return of this method. Overwrite if you want something else than <tt>model_name.plural</tt>.
|
data/lib/turbo/version.rb
CHANGED
data/lib/turbo-rails.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.0.pre.beta.
|
4
|
+
version: 2.0.0.pre.beta.2
|
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: 2023-
|
13
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activejob
|