From f2d8d13c6495f2a9b3bbf3b50d869c0e5b25c207 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 25 Aug 2008 21:44:21 -0500 Subject: Performance: Cache modules that extend the view context for JavaScriptGenerator --- actionpack/lib/action_view/base.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/base.rb') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index cc89c66a39..e1f35b8105 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -158,6 +158,7 @@ module ActionView #:nodoc: # See the ActionView::Helpers::PrototypeHelper::GeneratorMethods documentation for more details. class Base include ERB::Util + extend ActiveSupport::Memoizable attr_accessor :base_path, :assigns, :template_extension attr_accessor :controller @@ -324,11 +325,14 @@ module ActionView #:nodoc: template end end - - extend ActiveSupport::Memoizable memoize :pick_template private + def extended_by_without_helpers #:nodoc: + extended_by.reject { |mod| mod.name =~ /^ActionView::Helpers/ } + end + memoize :extended_by_without_helpers + # Evaluate the local assigns and pushes them to the view. def evaluate_assigns unless @assigns_added -- cgit v1.2.3