aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/render/rendering.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-27 20:51:25 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-27 20:52:11 +0100
commita09e99259c688a839bd5b4635da6f119dd1e0e41 (patch)
tree9e1399562185082853aacc837211f837f7a5a231 /actionpack/lib/action_view/render/rendering.rb
parentfdebc7f55bdd9730216ac1f00880838ae0db90bd (diff)
downloadrails-a09e99259c688a839bd5b4635da6f119dd1e0e41.tar.gz
rails-a09e99259c688a839bd5b4635da6f119dd1e0e41.tar.bz2
rails-a09e99259c688a839bd5b4635da6f119dd1e0e41.zip
Ensure details are frozen after @details_keys lookup. The implementation waits to freeze until the last required moment, to avoid duping hashes.
Diffstat (limited to 'actionpack/lib/action_view/render/rendering.rb')
-rw-r--r--actionpack/lib/action_view/render/rendering.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb
index a8f745afd1..492326964a 100644
--- a/actionpack/lib/action_view/render/rendering.rb
+++ b/actionpack/lib/action_view/render/rendering.rb
@@ -21,7 +21,7 @@ module ActionView
_render_partial(options)
else
template = _determine_template(options)
- _freeze_formats(template.formats)
+ lookup_context.freeze_formats(template.formats, true)
_render_template(template, options[:layout], options)
end
when :update
@@ -62,14 +62,5 @@ module ActionView
content
end
end
-
- # Freeze the current formats in the lookup context. By freezing them, you are guaranteeing
- # that next template lookups are not going to modify the formats. The controller can also
- # use this, to ensure that formats won't be further modified (as it does in respond_to blocks).
- def _freeze_formats(formats) #:nodoc:
- return if self.formats.frozen?
- self.formats = formats
- self.formats.freeze
- end
end
end