From eb33bd944d03d174ac7eac5d59fc280b35b1a3bd Mon Sep 17 00:00:00 2001 From: brainopia Date: Wed, 19 Jan 2011 17:10:01 +0300 Subject: Psych correctly gets visitor for SafeBuffer from superclass --- activesupport/lib/active_support/core_ext/string/output_safety.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'activesupport') 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 -- cgit v1.2.3