Merge branch 'master' of git://github.com/jchris/couchrest
* 'master' of git://github.com/jchris/couchrest: Fix up set_default to not munge existing values. commented out spec for fm:generate app
This commit is contained in:
commit
a2aa4a9a3c
3 changed files with 55 additions and 32 deletions
|
@ -506,9 +506,10 @@ module CouchRest
|
|||
private
|
||||
|
||||
def apply_defaults
|
||||
return unless new_document?
|
||||
if self.class.default
|
||||
self.class.default.each do |k,v|
|
||||
self[k] = v
|
||||
self[k] = v unless self.key?(k.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue