diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-14 17:40:03 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-14 17:40:58 -0500 |
commit | 9dc258d6147c8dab772d1f041098a38389cd3e73 (patch) | |
tree | 01f14b0fbc7c74b0a87bfbcb0bb9a20835ecac9e /actionpack/lib/action_view/renderable.rb | |
parent | 76df9fa0680d62ce41fa6f3b743c605101d101d2 (diff) | |
download | rails-9dc258d6147c8dab772d1f041098a38389cd3e73.tar.gz rails-9dc258d6147c8dab772d1f041098a38389cd3e73.tar.bz2 rails-9dc258d6147c8dab772d1f041098a38389cd3e73.zip |
Eager load Partial variable_name and counter_name. Tidy up render_partial_collection.
Diffstat (limited to 'actionpack/lib/action_view/renderable.rb')
-rw-r--r-- | actionpack/lib/action_view/renderable.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index ffcffd1667..4fda408367 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -7,16 +7,21 @@ module ActionView @@mutex = Mutex.new end - # NOTE: Exception to earlier notice. Ensure this is called before freeze def handler @handler ||= Template.handler_class_for_extension(extension) end - # NOTE: Exception to earlier notice. Ensure this is called before freeze def compiled_source @compiled_source ||= handler.new(nil).compile(self) if handler.compilable? end + def freeze + # Eager load and freeze memoized methods + handler.freeze + compiled_source.freeze + super + end + def render(view, local_assigns = {}) view._first_render ||= self view._last_render = self |