Skip to content

Commit

Permalink
Merge pull request #23185 from droptheplot/actioncable-custom-channels
Browse files Browse the repository at this point in the history
ActionCable: Allow adding custom paths for channels
  • Loading branch information
kaspth committed Jan 24, 2016
2 parents 62aa850 + a17f7a0 commit 323ec89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions actioncable/lib/action_cable/server/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Server
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

Expand All @@ -15,13 +15,15 @@ def initialize
@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
Expand Down

0 comments on commit 323ec89

Please sign in to comment.