commit 83282fc35c17fa1988bb5a3b2158a3eb34ecdfb7
parent 847a853498ed41684aa9e6215090149d93034425
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Fri, 4 Sep 2009 11:14:07 -0400
bugfix in yaml serialization
Objects that don't respond to before_marshal were being turned into false.
Whoops!
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup.rb b/lib/sup.rb
@@ -88,8 +88,10 @@ module Redwood
def save_yaml_obj o, fn, safe=false
o = if o.is_a?(Array)
o.map { |x| (x.respond_to?(:before_marshal) && x.before_marshal) || x }
+ elsif o.respond_to? :before_marshal
+ o.before_marshal
else
- o.respond_to?(:before_marshal) && o.before_marshal
+ o
end
if safe