aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-01-16 20:36:50 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-01-16 20:36:59 -0800
commitfe013ce93415a88b6c23fd750bd8cbab60d6395d (patch)
tree211ac518a754427867e50a11fb22da8861fd3e1a /actionpack
parent78af2710695973bbd747738d175fb3b1f488df6c (diff)
downloadrails-fe013ce93415a88b6c23fd750bd8cbab60d6395d.tar.gz
rails-fe013ce93415a88b6c23fd750bd8cbab60d6395d.tar.bz2
rails-fe013ce93415a88b6c23fd750bd8cbab60d6395d.zip
Fix performance regression
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/template.rb2
-rw-r--r--actionpack/lib/action_view/template_handlers.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 88ee07d95b..9d1e0d3ac5 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -204,7 +204,7 @@ module ActionView #:nodoc:
private
def valid_extension?(extension)
- Template.template_handler_extensions.include?(extension)
+ !Template.registered_template_handler(extension).nil?
end
def find_full_path(path, load_paths)
diff --git a/actionpack/lib/action_view/template_handlers.rb b/actionpack/lib/action_view/template_handlers.rb
index d06ddd5fb5..205f8628f0 100644
--- a/actionpack/lib/action_view/template_handlers.rb
+++ b/actionpack/lib/action_view/template_handlers.rb
@@ -32,13 +32,17 @@ module ActionView #:nodoc:
@@template_handlers.keys.map(&:to_s).sort
end
+ def registered_template_handler(extension)
+ extension && @@template_handlers[extension.to_sym]
+ end
+
def register_default_template_handler(extension, klass)
register_template_handler(extension, klass)
@@default_template_handlers = klass
end
def handler_class_for_extension(extension)
- (extension && @@template_handlers[extension.to_sym]) || @@default_template_handlers
+ registered_template_handler(extension) || @@default_template_handlers
end
end
end