fixed a bug with a default value being a proc

This commit is contained in:
Matt Aimonetti 2009-02-09 12:08:55 -08:00
parent 621f5565e9
commit e07e5b468f
2 changed files with 10 additions and 3 deletions

View file

@ -25,7 +25,7 @@ module CouchRest
# let's make sure we have a default and we can assign the value
if property.default && (self.respond_to?("#{key}=") || self.key?(key))
if property.default.class == Proc
self[key] = v.call
self[key] = property.default.call
else
self[key] = Marshal.load(Marshal.dump(property.default))
end