aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-23 11:23:25 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-23 11:23:25 -0500
commite0db925be04ab3e9c3db67dd0daa8caf3680dd21 (patch)
treee2bb3e5f7635ec3a3ac67dfc406b1b37e73c6e06
parent97a954bf1dd05e79a873bffc94fcf5420b807371 (diff)
downloadrails-e0db925be04ab3e9c3db67dd0daa8caf3680dd21.tar.gz
rails-e0db925be04ab3e9c3db67dd0daa8caf3680dd21.tar.bz2
rails-e0db925be04ab3e9c3db67dd0daa8caf3680dd21.zip
Revert 'bc5896e'
-rw-r--r--actionpack/lib/action_view/base.rb3
-rw-r--r--actionpack/lib/action_view/partials.rb9
2 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index bdcb1dc246..c769013d42 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -332,9 +332,6 @@ module ActionView #:nodoc:
end
end
- extend ActiveSupport::Memoizable
- memoize :pick_template
-
private
# Renders the template present at <tt>template_path</tt>. The hash in <tt>local_assigns</tt>
# is made available as local variables.
diff --git a/actionpack/lib/action_view/partials.rb b/actionpack/lib/action_view/partials.rb
index eb74d4a4c7..5aa4c83009 100644
--- a/actionpack/lib/action_view/partials.rb
+++ b/actionpack/lib/action_view/partials.rb
@@ -102,8 +102,6 @@ module ActionView
#
# As you can see, the <tt>:locals</tt> hash is shared between both the partial and its layout.
module Partials
- extend ActiveSupport::Memoizable
-
private
def render_partial(partial_path, object_assigns = nil, local_assigns = {}) #:nodoc:
local_assigns ||= {}
@@ -131,12 +129,14 @@ module ActionView
local_assigns = local_assigns ? local_assigns.clone : {}
spacer = partial_spacer_template ? render(:partial => partial_spacer_template) : ''
+ _paths = {}
+ _templates = {}
index = 0
collection.map do |object|
_partial_path ||= partial_path || ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
- path = find_partial_path(_partial_path)
- template = pick_template(path)
+ path = _paths[_partial_path] ||= find_partial_path(_partial_path)
+ template = _templates[path] ||= pick_template(path)
local_assigns[template.counter_name] = index
result = template.render_partial(self, object, local_assigns, as)
index += 1
@@ -153,6 +153,5 @@ module ActionView
"_#{partial_path}"
end
end
- memoize :find_partial_path
end
end