aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer/abstract_renderer.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-04-26 22:21:47 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-12 22:34:23 -0300
commit700c58355c04595795b03ff29e727eac7200e928 (patch)
tree5bd526bc9dab7c67334836fbb4d4631fb9b7668e /actionpack/lib/action_view/renderer/abstract_renderer.rb
parent99e2a223e8a5fd0943f2e2168fb2866eb831030c (diff)
downloadrails-700c58355c04595795b03ff29e727eac7200e928.tar.gz
rails-700c58355c04595795b03ff29e727eac7200e928.tar.bz2
rails-700c58355c04595795b03ff29e727eac7200e928.zip
Improve and cleanup a bit partial renderer
* Remove template assignment: there is no need for this assignment, given we are rendering a collection with possibly different templates, and a second call to render (with the same instance) would behave differently if the template is set. * Remove segments array in favor of Array#map * Use local vars whenever possible * Cache local template keys, remove defaults from find_template
Diffstat (limited to 'actionpack/lib/action_view/renderer/abstract_renderer.rb')
-rw-r--r--actionpack/lib/action_view/renderer/abstract_renderer.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionpack/lib/action_view/renderer/abstract_renderer.rb
index 52473cd222..72616b7463 100644
--- a/actionpack/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionpack/lib/action_view/renderer/abstract_renderer.rb
@@ -14,12 +14,10 @@ module ActionView
protected
def extract_details(options)
- details = {}
- @lookup_context.registered_details.each do |key|
+ @lookup_context.registered_details.each_with_object({}) do |key, details|
next unless value = options[key]
details[key] = Array(value)
end
- details
end
def instrument(name, options={})