1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Merge pull request #398 from brainopia/master

Compatibility with rails head
This commit is contained in:
Nathan Weizenbaum 2011-06-07 23:22:07 -07:00
commit ffb73065aa
2 changed files with 6 additions and 3 deletions

View file

@ -54,7 +54,7 @@ end
# Patching was necessary for versions <= 2.0.1, # Patching was necessary for versions <= 2.0.1,
# but we can make it a normal handler for higher versions. # but we can make it a normal handler for higher versions.
if defined?(ActionView::TemplateHandler) || if defined?(ActionView::TemplateHandler) ||
(defined?(ActionView::Template) && defined?(ActionView::Template::Handler)) (defined?(ActionView::Template) && defined?(ActionView::Template::Handlers))
require 'haml/template/plugin' require 'haml/template/plugin'
else else
require 'haml/template/patch' require 'haml/template/patch'

View file

@ -424,8 +424,11 @@ WARNING
# For example, `:Error` will return `ActionView::TemplateError` # For example, `:Error` will return `ActionView::TemplateError`
# or `ActionView::Template::Error`. # or `ActionView::Template::Error`.
def av_template_class(name) def av_template_class(name)
return ActionView.const_get("Template#{name}") if ActionView.const_defined?("Template#{name}") if ActionView::Template.const_defined?(name)
return ActionView::Template.const_get(name.to_s) ActionView::Template.const_get(name)
else
ActionView.const_get("Template#{name}")
end
end end
## Rails XSS Safety ## Rails XSS Safety