aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-14 19:51:43 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-14 19:51:43 -0500
commitdd41f66af577947ad420fbd2a44184344ad5c983 (patch)
tree26eaa2f32cb192b0c289979655b4bd333ca34de7 /actionpack/lib/action_view/renderable.rb
parent8a9934a9d9fc98b56c4566ae2e3fd4d83e505d3e (diff)
downloadrails-dd41f66af577947ad420fbd2a44184344ad5c983.tar.gz
rails-dd41f66af577947ad420fbd2a44184344ad5c983.tar.bz2
rails-dd41f66af577947ad420fbd2a44184344ad5c983.zip
Include Memoizable in ActionView::Template
Diffstat (limited to 'actionpack/lib/action_view/renderable.rb')
-rw-r--r--actionpack/lib/action_view/renderable.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb
index 4fda408367..9185045adf 100644
--- a/actionpack/lib/action_view/renderable.rb
+++ b/actionpack/lib/action_view/renderable.rb
@@ -7,20 +7,17 @@ module ActionView
@@mutex = Mutex.new
end
+ include ActiveSupport::Memoizable
+
def handler
- @handler ||= Template.handler_class_for_extension(extension)
+ Template.handler_class_for_extension(extension)
end
+ memorize :handler
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
+ handler.new(nil).compile(self) if handler.compilable?
end
+ memorize :compiled_source
def render(view, local_assigns = {})
view._first_render ||= self