Modified CastedModel to apply defaults first
(so the defaults don't overwrite modified values) Included failing (and now passing) specs
This commit is contained in:
parent
0647307acd
commit
dff005f082
2 changed files with 35 additions and 5 deletions
|
@ -10,12 +10,12 @@ module CouchRest
|
|||
|
||||
def initialize(keys={})
|
||||
raise StandardError unless self.is_a? Hash
|
||||
apply_defaults # defined in CouchRest::Mixins::Properties
|
||||
super()
|
||||
keys.each do |k,v|
|
||||
self[k.to_s] = v
|
||||
end if keys
|
||||
apply_defaults # defined in CouchRest::Mixins::Properties
|
||||
# cast_keys # defined in CouchRest::Mixins::Properties
|
||||
cast_keys # defined in CouchRest::Mixins::Properties
|
||||
end
|
||||
|
||||
def []= key, value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue