Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8777 from goshakkk/delegate-class

Delegate to :class rather than 'self.class'
  • Loading branch information...
commit f18078475efce9eeef27d64044058539517b0260 2 parents 7843e00 + 7a439d2
@pixeltrix pixeltrix authored
View
2  actionpack/lib/abstract_controller/layouts.rb
@@ -209,7 +209,7 @@ module Layouts
_write_layout_method
end
- delegate :_layout_conditions, :to => "self.class"
+ delegate :_layout_conditions, to: :class
module ClassMethods
def inherited(klass) # :nodoc:
View
2  actionpack/lib/action_view/template/resolver.rb
@@ -118,7 +118,7 @@ def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
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
View
2  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.
View
2  railties/lib/rails/engine.rb
@@ -410,7 +410,7 @@ def find(path)
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
View
2  railties/lib/rails/railtie.rb
@@ -172,7 +172,7 @@ def generate_railtie_name(class_or_module)
end
end
- delegate :railtie_name, to: "self.class"
+ delegate :railtie_name, to: :class
def config
@config ||= Railtie::Configuration.new
Please sign in to comment.
Something went wrong with that request. Please try again.