aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable.rb
diff options
context:
space:
mode:
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