diff --git a/lib/couchrest/core/model.rb b/lib/couchrest/core/model.rb index 0fccb27..9d38cb8 100644 --- a/lib/couchrest/core/model.rb +++ b/lib/couchrest/core/model.rb @@ -526,7 +526,11 @@ module CouchRest def apply_defaults if self.class.default self.class.default.each do |k,v| - self[k] = v + if v.class == Proc + self[k.to_s] = v.call + else + self[k.to_s] = Marshal.load(Marshal.dump(v)) + end end end end