Open britishtea opened 9 years ago
I personally solved this issue without deep cloning via Marshal
since have two problems with Marshal
Marshal
I am using this cuba-plugin https://github.com/mkristian/cuba-api/blob/master/lib/cuba_api/config.rb
which replaces Cuba.settings['x']
with Cuba['x']
which behaves like settings but fixes the two above problems. sorry that I never attempt to bring this in as PR to cuba itself.
I added a comment, please let me know what you guys think: https://github.com/soveran/cuba/issues/21#issuecomment-171940039
This fixes an issue where settings are added to Cuba.settings after inheriting from
Cuba
are not picked up by the child classes. The problem is described in issue #21.If a setting does not exist, settings are looked up in the settings Hash of the parent class using
Hash#default_proc
. The settings Hash is still deepcloned, so settings are still overridable.