Permalink
Browse files

Merge pull request #8777 from goshakkk/delegate-class

Delegate to :class rather than 'self.class'
  • Loading branch information...
2 parents 7843e00 + 7a439d2 commit f18078475efce9eeef27d64044058539517b0260 @pixeltrix pixeltrix committed Jan 6, 2013
@@ -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:
@@ -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
@@ -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.
@@ -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
@@ -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

0 comments on commit f180784

Please sign in to comment.