diff options
author | brainopia <brainopia@evilmartians.com> | 2011-01-19 17:10:01 +0300 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-28 14:32:53 -0800 |
commit | eb33bd944d03d174ac7eac5d59fc280b35b1a3bd (patch) | |
tree | 27634dd63f3fd6c39a18df805eaa49f8fcf6087c /activesupport | |
parent | 452dba72f5bac3118a3405408665ae372ebbe6a1 (diff) | |
download | rails-eb33bd944d03d174ac7eac5d59fc280b35b1a3bd.tar.gz rails-eb33bd944d03d174ac7eac5d59fc280b35b1a3bd.tar.bz2 rails-eb33bd944d03d174ac7eac5d59fc280b35b1a3bd.zip |
Psych correctly gets visitor for SafeBuffer from superclass
Diffstat (limited to 'activesupport')
-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 |