Adding property build support to enable CastedArray#build
This commit is contained in:
parent
d56179aa6b
commit
fcd9e2ba8e
5 changed files with 57 additions and 3 deletions
|
@ -50,6 +50,12 @@ module CouchRest::Model
|
|||
super
|
||||
end
|
||||
|
||||
def build(*args)
|
||||
obj = casted_by_property.build(*args)
|
||||
self.push(obj)
|
||||
obj
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def instantiate_and_cast(obj, change = true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue