diff options
Diffstat (limited to 'actioncable/lib/action_cable/engine.rb')
-rw-r--r-- | actioncable/lib/action_cable/engine.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actioncable/lib/action_cable/engine.rb b/actioncable/lib/action_cable/engine.rb index e395500eed..fbe8038a57 100644 --- a/actioncable/lib/action_cable/engine.rb +++ b/actioncable/lib/action_cable/engine.rb @@ -18,11 +18,16 @@ module ActionCable end initializer "action_cable.set_configs" do |app| + app.paths.add "config/redis/cable", with: "config/redis/cable.yml" + options = app.config.action_cable options.allowed_request_origins ||= "http://localhost:3000" if ::Rails.env.development? ActiveSupport.on_load(:action_cable) do + path = Pathname.new(paths["config/redis/cable"].existent.first) + self.redis = Rails.application.config_for(redis_path).with_indifferent_access + options.each { |k,v| send("#{k}=", v) } end end |