Skip to content

Commit cf69d50

Browse files
committed
Add temporary patch until solid cable's patch gets merged
rails/solid_cable#50
1 parent a52d023 commit cf69d50

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module HotwireSpark::ActionCable::SolidCableWithSafeReloads
2+
private
3+
def broadcast_messages
4+
Rails.application.reloader.wrap do
5+
super
6+
end
7+
end
8+
end

lib/hotwire_spark/installer.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def install
1919
def configure_middleware
2020
::ActionCable::Server::Base.prepend(HotwireSpark::ActionCable::PersistentCableServer)
2121

22+
# TODO: Temporary patch until this gets merged https://github.com/rails/solid_cable/pull/50
23+
if defined?(::ActionCable::SubscriptionAdapter::SolidCable::Listener)
24+
ActionCable::SubscriptionAdapter::SolidCable::Listener.prepend(HotwireSpark::ActionCable::SolidCableWithSafeReloads)
25+
end
26+
2227
middleware.insert_before ActionDispatch::Executor, HotwireSpark::ActionCable::PersistentCableMiddleware
2328
middleware.use HotwireSpark::Middleware
2429
end

0 commit comments

Comments
 (0)