When calling Setting. within an initializer, it only returns the default value (set in app.yml). However, Setting.get_all does contain the value from the database.
Could this be because the initializer where I'm calling Setting is evaluated before initializer 'rails_settings.active_record.initialization'?
EDIT: Just to be clear, the workaround I've found is to call Setting.get_all['<key>'], but I'm not sure why that works and Setting.<key> doesn't.
However, using Setting.get_all[''] is not viable solution for me as we need to have a default in the app.yml that can be overwritten and used by the initializer if it is.
When calling Setting. within an initializer, it only returns the default value (set in app.yml). However, Setting.get_all does contain the value from the database.
Could this be because the initializer where I'm calling Setting is evaluated before
initializer 'rails_settings.active_record.initialization'
?EDIT: Just to be clear, the workaround I've found is to call
Setting.get_all['<key>']
, but I'm not sure why that works andSetting.<key>
doesn't.