translate_enum
translate_enum copied to clipboard
Added global configuration support
Hi I needed to add global configuration support for an app that I was working on, had lots of lists and the activerecord.attributes file started to feel too clogged, but also didn't want to add a block for each class on the translate_enum methods. It could be useful in the future to easily add new global settings. Let me know if you are interested in adding this to the project, I tried to change as little as possible, but it could use some improvements.
# config/initializers/translate_enum_config.rb
TranslateEnum.configure do |config|
config.i18n_scope = 'translate_enums'
end
then call the configuration like
TranslateEnum.config.i18n_scope