aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/template.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/template/template.rb')
-rw-r--r--actionpack/lib/action_view/template/template.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/template.rb b/actionpack/lib/action_view/template/template.rb
index 8f23f9b9e3..7d6964e3e3 100644
--- a/actionpack/lib/action_view/template/template.rb
+++ b/actionpack/lib/action_view/template/template.rb
@@ -97,7 +97,22 @@ module ActionView
raise ActionView::TemplateError.new(self, {}, e)
end
end
-
+
+ class LocalsKey
+ @hash_keys = Hash.new {|h,k| h[k] = Hash.new {|h,k| h[k] = {} } }
+
+ def self.get(*locals)
+ @hash_keys[*locals] ||= new(klass, format, locale)
+ end
+
+ attr_accessor :hash
+ def initialize(klass, format, locale)
+ @hash = locals.hash
+ end
+
+ alias_method :eql?, :equal?
+ end
+
def build_method_name(locals)
# TODO: is locals.keys.hash reliably the same?
@method_names[locals.keys.hash] ||=