@charlag@movonw Autoloading isn't random. You *can* understand where something comes from. There is a config that defines which paths to autoload from, and there's a rule of directory structure and file names that's required for it to work.
@charlag@movonw So we autoload everything in the app directory. Admin::AccountAction must be in admin/account_action.rb, and because it's not named Controller or Service or Worker it'll be in the models directory. It could also be in the lib directory if it's not strictly speaking a model or related to representing data, but app/lib is not a Rails default, that's just helpful to us in Mastodon because we have a lot of complicated shit.
@charlag @movonw So we autoload everything in the app directory. Admin::AccountAction must be in admin/account_action.rb, and because it's not named Controller or Service or Worker it'll be in the models directory. It could also be in the lib directory if it's not strictly speaking a model or related to representing data, but app/lib is not a Rails default, that's just helpful to us in Mastodon because we have a lot of complicated shit.