diff options
author | Genadi Samokovarov <gsamokovarov@gmail.com> | 2017-05-31 12:16:20 +0300 |
---|---|---|
committer | Genadi Samokovarov <gsamokovarov@gmail.com> | 2017-06-03 13:52:48 +0300 |
commit | b6b0c99ff3e8ace3f42813154dbe4b8ad6a98e6c (patch) | |
tree | 5d2f9250f66f675280c2761daa52880b28d6a86e /actioncable/lib/action_cable | |
parent | a5b0c60714e1e8d8c182af830a26e1c7c884271d (diff) | |
download | rails-b6b0c99ff3e8ace3f42813154dbe4b8ad6a98e6c.tar.gz rails-b6b0c99ff3e8ace3f42813154dbe4b8ad6a98e6c.tar.bz2 rails-b6b0c99ff3e8ace3f42813154dbe4b8ad6a98e6c.zip |
Use mattr_accessor default: option throughout the project
Diffstat (limited to 'actioncable/lib/action_cable')
3 files changed, 4 insertions, 4 deletions
diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb index 419eccd73c..3b3a17a532 100644 --- a/actioncable/lib/action_cable/server/base.rb +++ b/actioncable/lib/action_cable/server/base.rb @@ -10,7 +10,7 @@ module ActionCable include ActionCable::Server::Broadcasting include ActionCable::Server::Connections - cattr_accessor(:config, instance_accessor: true) { ActionCable::Server::Configuration.new } + cattr_accessor :config, instance_accessor: true, default: ActionCable::Server::Configuration.new def self.logger; config.logger; end delegate :logger, to: :config diff --git a/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb b/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb index ed8f315791..ae71708240 100644 --- a/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb +++ b/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb @@ -17,11 +17,11 @@ module ActionCable # Overwrite this factory method for EventMachine Redis connections if you want to use a different Redis connection library than EM::Hiredis. # This is needed, for example, when using Makara proxies for distributed Redis. - cattr_accessor(:em_redis_connector) { ->(config) { EM::Hiredis.connect(config[:url]) } } + cattr_accessor :em_redis_connector, default: ->(config) { EM::Hiredis.connect(config[:url]) } # Overwrite this factory method for Redis connections if you want to use a different Redis connection library than Redis. # This is needed, for example, when using Makara proxies for distributed Redis. - cattr_accessor(:redis_connector) { ->(config) { ::Redis.new(url: config[:url]) } } + cattr_accessor :redis_connector, default: ->(config) { ::Redis.new(url: config[:url]) } def initialize(*) ActiveSupport::Deprecation.warn(<<-MSG.squish) diff --git a/actioncable/lib/action_cable/subscription_adapter/redis.rb b/actioncable/lib/action_cable/subscription_adapter/redis.rb index 41a6e55822..a31ed33bdb 100644 --- a/actioncable/lib/action_cable/subscription_adapter/redis.rb +++ b/actioncable/lib/action_cable/subscription_adapter/redis.rb @@ -10,7 +10,7 @@ module ActionCable # Overwrite this factory method for redis connections if you want to use a different Redis library than Redis. # This is needed, for example, when using Makara proxies for distributed Redis. - cattr_accessor(:redis_connector) { ->(config) { ::Redis.new(url: config[:url]) } } + cattr_accessor :redis_connector, default: ->(config) { ::Redis.new(url: config[:url]) } def initialize(*) super |