diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-06 05:00:54 -0800 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-06 05:00:54 -0800 |
commit | f18078475efce9eeef27d64044058539517b0260 (patch) | |
tree | 9c6245a12f9dd4ed8b3f5e018fc9a0f3b415164c | |
parent | 7843e009d2bc8d088437ff6f43e47ba113de9dee (diff) | |
parent | 7a439d23de4c7c187b0deda8e02138b3dccf0181 (diff) | |
download | rails-f18078475efce9eeef27d64044058539517b0260.tar.gz rails-f18078475efce9eeef27d64044058539517b0260.tar.bz2 rails-f18078475efce9eeef27d64044058539517b0260.zip |
Merge pull request #8777 from goshakkk/delegate-class
Delegate to :class rather than 'self.class'
-rw-r--r-- | actionpack/lib/abstract_controller/layouts.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 2 | ||||
-rw-r--r-- | guides/source/active_support_core_extensions.md | 2 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/railtie.rb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 73799e8085..91864f2a35 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -209,7 +209,7 @@ module AbstractController _write_layout_method end - delegate :_layout_conditions, :to => "self.class" + delegate :_layout_conditions, to: :class module ClassMethods def inherited(klass) # :nodoc: diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 8b23029bbc..1a1083bf00 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -118,7 +118,7 @@ module ActionView private - delegate :caching?, :to => "self.class" + delegate :caching?, to: :class # This is what child classes implement. No defaults are needed # because Resolver guarantees that the arguments are present and diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index dd589ff8e3..7f03363b23 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -920,7 +920,7 @@ When interpolated into a string, the `:to` option should become an expression th delegate :logger, to: :Rails # delegates to the receiver's class -delegate :table_name, to: 'self.class' +delegate :table_name, to: :class ``` WARNING: If the `:prefix` option is `true` this is less generic, see below. diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 725295004f..3ba62039de 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -410,7 +410,7 @@ module Rails self.isolated = false delegate :middleware, :root, :paths, to: :config - delegate :engine_name, :isolated?, to: "self.class" + delegate :engine_name, :isolated?, to: :class def initialize @_all_autoload_paths = nil diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 5b454e7f20..9437e9c406 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -172,7 +172,7 @@ module Rails end end - delegate :railtie_name, to: "self.class" + delegate :railtie_name, to: :class def config @config ||= Railtie::Configuration.new |