rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.08k stars 161 forks source link

Relax freezing policy for `ROM::Configurable` #616

Closed v-kolesnikov closed 3 years ago

v-kolesnikov commented 3 years ago

Describe the bug

Freezing configuration settings in ROM::Support::Configurable is too aggressive https://github.com/rom-rb/rom/blob/d34b4795b7d91598be7ad7be9c0aa9dc82d54771/core/lib/rom/support/configurable.rb#L39

To Reproduce

Configuration setting may be an object that has mutations on itself, so we shouldn't freeze that objects. For example: https://github.com/rom-rb/rom-elasticsearch/pull/14

Expected behavior

Mutable objects could be able to set as configuration settings.