aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-01-24 18:14:59 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-01-24 18:14:59 +0100
commit323ec89aabc43180b6463d87028f468fb27fe8bc (patch)
tree024ce4a3cbc4bd0b15481051ece591e83b4dd6b8 /actioncable
parent62aa850fee2070ec3e2d9e4f925dfd7790d27b5e (diff)
parenta17f7a0bc12d1d2a4cbc8dfa62d3bcb94ed48c45 (diff)
downloadrails-323ec89aabc43180b6463d87028f468fb27fe8bc.tar.gz
rails-323ec89aabc43180b6463d87028f468fb27fe8bc.tar.bz2
rails-323ec89aabc43180b6463d87028f468fb27fe8bc.zip
Merge pull request #23185 from droptheplot/actioncable-custom-channels
ActionCable: Allow adding custom paths for channels
Diffstat (limited to 'actioncable')
-rw-r--r--actioncable/lib/action_cable/server/configuration.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actioncable/lib/action_cable/server/configuration.rb b/actioncable/lib/action_cable/server/configuration.rb
index ebbf60c6e2..9a248933c4 100644
--- a/actioncable/lib/action_cable/server/configuration.rb
+++ b/actioncable/lib/action_cable/server/configuration.rb
@@ -5,7 +5,7 @@ module ActionCable
class Configuration
attr_accessor :logger, :log_tags
attr_accessor :connection_class, :worker_pool_size
- attr_accessor :channels_path
+ attr_accessor :channel_load_paths
attr_accessor :disable_request_forgery_protection, :allowed_request_origins
attr_accessor :cable, :url
@@ -15,13 +15,15 @@ module ActionCable
@connection_class = ApplicationCable::Connection
@worker_pool_size = 100
- @channels_path = Rails.root.join('app/channels')
+ @channel_load_paths = [Rails.root.join('app/channels')]
@disable_request_forgery_protection = false
end
def channel_paths
- @channels ||= Dir["#{channels_path}/**/*_channel.rb"]
+ @channel_paths ||= channel_load_paths.flat_map do |path|
+ Dir["#{path}/**/*_channel.rb"]
+ end
end
def channel_class_names