I was setting some global variables (for setting devise gem authorization customization). So, I put some file auth_provider.rb in the config/auth folder where I declare some module MyAuth (in some myauth.rb file). The problem is that when this module is called by some file in the initializers folder, call it caller.rb, so that I had to put in the application.rb file
config.before_initialize do
Dir["#{config.root}/config/auth/*.rb"].each {|file|
require file
}
end
But I don't find it really natural. And, if I put auth_provider.rb in the initializers/auth folder, then caller.rb seems to be loaded before auth_provider.rb, so I get some namespace error (I presume the files are loaded by alphabetical order). So how, to load the auth_provider.rb before caller.rb in a more straightforward way ? Should I create some initializers/0_auth folder in order to be loaded in first ? (By the way, i want this configuration modular and to keep it clearly seperated from the rest of the 'proper' rails app config variable declaration)