I have a hard time understanding an issue with Rails autoloading.
So I have a controller which is located in a folder named api. The constroller is declared as class Api::TestController.
In another folder, I have a file called app/my_folder/service_name/api.rb
In production, I get this error : load_missing_constant': Unable to autoload constant Api, expected /app/my_folder/service_name/api.rb to define it (LoadError)
application.rb has this line :
config.autoload_paths += Dir[Rails.root.join('app', 'my_folder', '{**/}')]
I have no issues in development.
Why is this happening ?