From fc2aa53f875b12df93b0d07932e3ab563b89152c Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 23 Dec 2016 20:39:54 +0900 Subject: self. is not needed when calling its own instance method --- actionview/lib/action_view/template.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 45cf7e6a93..d56239789d 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -278,7 +278,6 @@ module ActionView # regardless of the original source encoding. def compile(mod) encode! - method_name = self.method_name code = @handler.call(self) # Make sure that the resulting String to be eval'd is in the @@ -333,7 +332,7 @@ module ActionView locals.each_with_object("") { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" } end - protected def method_name #:nodoc: + def method_name @method_name ||= begin m = "_#{identifier_method_name}__#{@identifier.hash}_#{__id__}" m.tr!("-".freeze, "_".freeze) -- cgit v1.2.3