diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-08-14 12:00:52 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-08-15 12:32:01 -0700 |
commit | 9b552fb300c4606fe517eadaa30708e9d75498a6 (patch) | |
tree | bdf53599767b72628e5ce49fa701cd953c69175c /actionpack/lib/action_view/template | |
parent | 9f5cd0156ab907d8097fc9c588823a9b09038b93 (diff) | |
download | rails-9b552fb300c4606fe517eadaa30708e9d75498a6.tar.gz rails-9b552fb300c4606fe517eadaa30708e9d75498a6.tar.bz2 rails-9b552fb300c4606fe517eadaa30708e9d75498a6.zip |
Caches and cache clearing seems to actually work, but the actual architecture is kind of messy. Next: CLEAN UP.
Diffstat (limited to 'actionpack/lib/action_view/template')
-rw-r--r-- | actionpack/lib/action_view/template/template.rb | 17 |
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] ||= |