Should be able to assign a casted hash to a hash property
Fixes https://github.com/couchrest/couchrest_model/issues/68 Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
This commit is contained in:
parent
a55cf56213
commit
d50d47c32a
3 changed files with 17 additions and 1 deletions
|
@ -39,7 +39,7 @@ module CouchRest::Model
|
|||
arr = value.collect { |data| cast_value(parent, data) }
|
||||
# allow casted_by calls to be passed up chain by wrapping in CastedArray
|
||||
CastedArray.new(arr, self, parent)
|
||||
elsif (type == Object || type == Hash) && (value.class == Hash)
|
||||
elsif (type == Object || type == Hash) && (value.kind_of?(Hash))
|
||||
# allow casted_by calls to be passed up chain by wrapping in CastedHash
|
||||
CastedHash[value, self, parent]
|
||||
elsif !value.nil?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue