lib/singlettings/rails.rb in singlettings-0.0.3 vs lib/singlettings/rails.rb in singlettings-0.0.4
- old
+ new
@@ -7,10 +7,20 @@
Singlettings.load_yaml_files! config_path
end
end
class Rails < ::Rails::Engine
- initializer 'singlettings' do
+ # The priorities of ActiveSupport hooks are shown as below:
+ # => before_configuration
+ # => before_initialize
+ # => before_eager_load
+ # => action_controller
+ # => action_view
+ # => active_record
+ # => after_initialize
+ # Since Singlettings is for configuration,
+ # it should be loaded before configuration.
+ config.before_configuration do
Singlettings.hook_rails!
end
end if defined?(::Rails)
private
\ No newline at end of file