aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-14 17:40:03 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-14 17:40:58 -0500
commit9dc258d6147c8dab772d1f041098a38389cd3e73 (patch)
tree01f14b0fbc7c74b0a87bfbcb0bb9a20835ecac9e /actionpack/lib/action_view/renderable.rb
parent76df9fa0680d62ce41fa6f3b743c605101d101d2 (diff)
downloadrails-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.rb9
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