Autoload paths and nested services classes crash in Ruby
Clash Royale CLAN TAG #URR8PPP Autoload paths and nested services classes crash in Ruby I've multiple issues to load / require classes under my app/services folder in a Rails 5 project and I'm starting to give up on this issue. app/services First of all and to be clear, services/ are simple PORO classes I use throughout my project to abstract most of the business logic from the controllers, models, etc. services/ The tree looks like this app/ services/ my_service/ base.rb funny_name.rb my_service.rb models/ funny_name.rb First, when I tried to use MyService.const_get('FunnyName') it got FunnyName from my models directory. It does not seem to have the same behavior when I do MyService::FunnyName directly though, in most of my tests and changes this was working fine, it's odd. MyService.const_get('FunnyName') FunnyName MyService::FunnyName I realised Rails config.autoload_paths does not load things recursively ; it would makes sense that t...