diff options
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index bb0f747960..29d6613611 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -1,5 +1,6 @@ require 'erb' require 'active_support/core_ext/kernel/singleton_class' +require 'active_support/core_ext/yaml' class ERB module Util @@ -101,8 +102,10 @@ module ActiveSupport #:nodoc: self end - def to_yaml(*args) - to_str.to_yaml(*args) + unless defined?(Psych) + def to_yaml(*args) + to_str.to_yaml(*args) + end end end end |