aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/render
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-08-09 01:37:03 -0300
committerYehuda Katz <wycats@gmail.com>2009-08-09 04:12:08 -0300
commit33f01fb1f6e0bf850e9366ef8203c4c944c27540 (patch)
treef42ab7b27049afca24289ab3b7e7720e93980b19 /actionpack/lib/action_view/render
parent0ab40b039bf7b7882a31ab187916bc2dc5a8ae7c (diff)
downloadrails-33f01fb1f6e0bf850e9366ef8203c4c944c27540.tar.gz
rails-33f01fb1f6e0bf850e9366ef8203c4c944c27540.tar.bz2
rails-33f01fb1f6e0bf850e9366ef8203c4c944c27540.zip
Cache some more things to improve partial perf
Diffstat (limited to 'actionpack/lib/action_view/render')
-rw-r--r--actionpack/lib/action_view/render/partials.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb
index 7a8c943b05..64f08c447d 100644
--- a/actionpack/lib/action_view/render/partials.rb
+++ b/actionpack/lib/action_view/render/partials.rb
@@ -178,7 +178,7 @@ module ActionView
end
def self.formats
- @formats ||= Hash.new {|h,k| h[k] = Hash.new {|h,k| h[k] = {}}}
+ @formats ||= Hash.new {|h,k| h[k] = Hash.new{|h,k| h[k] = Hash.new {|h,k| h[k] = {}}}}
end
def initialize(view_context, options, block)
@@ -192,7 +192,7 @@ module ActionView
# Set up some instance variables to speed up memoizing
@partial_names = self.class.partial_names[@view.controller.class]
@templates = self.class.formats
- @details_hash = [view_context.formats, I18n.locale].hash
+ @format = view_context.formats
# Set up the object and path
@object = partial.is_a?(String) ? options[:object] : partial
@@ -252,7 +252,7 @@ module ActionView
def find_template(path = @path)
return if !path
- @templates[@details_hash][path][@view.controller_path] ||= begin
+ @templates[path][@view.controller_path][@format][I18n.locale] ||= begin
prefix = @view.controller.controller_path unless path.include?(?/)
@view.find(path, {:formats => @view.formats}, prefix, true)
end