Skip to content

Commit

Permalink
Undef method before replacing it.
Browse files Browse the repository at this point in the history
In order to suppress warnings.
  • Loading branch information
mattwildig committed May 6, 2012
1 parent ab37190 commit cabe2a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/haml/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def try_enabling_xss_integration

Haml::Template.options[:escape_html] = true

Haml::Util.module_eval {def rails_xss_safe?; true; end}
Haml::Util.module_eval do
undef :rails_xss_safe? if defined? rails_xss_safe?
def rails_xss_safe?; true; end
end

require 'haml/helpers/xss_mods'
Haml::Helpers.send(:include, Haml::Helpers::XssMods)
Expand Down

0 comments on commit cabe2a7

Please sign in to comment.