fixed a bug with a default value being a proc
This commit is contained in:
parent
621f5565e9
commit
e07e5b468f
2 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue