Reverts t6d/smart_properties#26 due to unforeseen issues with HashWithIndifferentAccess instances. These hashes return the keys as they were originally inserted and potentially break the properties.key? check in the initializer.
The better solution would be to use the property collection instead of a to_hash version of this collection. To make this work, the property collection needs to implement caching for performance reasons.
A simple solution would have been to do key.to_sym, but since symbols are not GCed before 2.2, this might cause harm when mapping API input directly to SmartProperties enabled classes.
Reverts t6d/smart_properties#26 due to unforeseen issues with
HashWithIndifferentAccess
instances. These hashes return thekeys
as they were originally inserted and potentially break theproperties.key?
check in the initializer.The better solution would be to use the property collection instead of a
to_hash
version of this collection. To make this work, the property collection needs to implement caching for performance reasons.A simple solution would have been to do
key.to_sym
, but since symbols are not GCed before 2.2, this might cause harm when mapping API input directly toSmartProperties
enabled classes.