Skip to content

Commit

Permalink
ruby >= 2.7 may raise NameError when const_getting the handler Erubi …
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed May 25, 2019
1 parent 9374849 commit 09cb8ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/haml/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Railtie < ::Rails::Railtie
# solved by looking for ::Erubi first.
# However, in JRuby, the const_defined? finds it anyway, so we must make sure that it's
# not just a reference to ::Erubi.
if defined?(::Erubi) && (Object.const_get('::ActionView::Template::Handlers::ERB::Erubi') != ::Erubi)
if defined?(::Erubi) && (::ActionView::Template::Handlers::ERB.const_get('Erubi') != ::Erubi)
require "haml/helpers/safe_erubi_template"
Haml::Filters::RailsErb.template_class = Haml::SafeErubiTemplate
else
Expand Down

0 comments on commit 09cb8ef

Please sign in to comment.