mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Check for Rails before using __in_erb_template
The tests all load (some version of) Rails. Haml is not always going to be used in a Rails environment, and ap_ge3? will be false in these situations, so __in_erb_template will be used, generating needless warnings. Check that Rails is loaded, as well as it being an earlier version, before using __in_erb_template in generated code.
This commit is contained in:
parent
535840d97b
commit
e1510319a4
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ extend Haml::Helpers
|
|||
_hamlout = @haml_buffer = Haml::Buffer.new(haml_buffer, #{options_for_buffer.inspect})
|
||||
_erbout = _hamlout.buffer
|
||||
END
|
||||
preamble << "__in_erb_template = true;" unless ap_geq_3?
|
||||
preamble << "__in_erb_template = true;" if rails_env && !ap_geq_3?
|
||||
postamble = <<END.gsub("\n", ";")
|
||||
#{precompiled_method_return_value}
|
||||
ensure
|
||||
|
|
Loading…
Add table
Reference in a new issue