Handle default values properly

This commit is contained in:
wildchild 2009-06-16 04:31:50 +06:00 committed by Matt Aimonetti
parent c18567f8fc
commit f9d8f09ab9
2 changed files with 6 additions and 1 deletions

View file

@ -24,7 +24,7 @@ module CouchRest
self.class.properties.each do |property|
key = property.name.to_s
# let's make sure we have a default
if property.default
unless property.default.nil?
if property.default.class == Proc
self[key] = property.default.call
else