Using Classes instead of strings for typecasting and removing redundant comparisons
This commit is contained in:
parent
e922b81ccc
commit
64d68ecc1a
2 changed files with 12 additions and 17 deletions
|
@ -57,6 +57,7 @@ module CouchRest
|
|||
associate_casted_to_parent(value, assigned)
|
||||
value
|
||||
end
|
||||
# only cast arrays of more complex objects (i.e. not strings)
|
||||
self[key] = klass != String ? CastedArray.new(arr) : arr
|
||||
self[key].casted_by = self if self[key].respond_to?(:casted_by)
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue