Reputation: 399
I would like to have a folder of related Models in my Rails 4 app. Why don't classes in app/models/debt_models get loaded?
I guess there is a work around by how come Rails just doesn't recursively go through folders under app/models? Is there a reason? Seems like this is something Rails should do without me having to tell Rails to do that.
Upvotes: 1
Views: 92
Reputation: 115511
You just have to follow conventions. If you put models in debt_models
, it means you namespace them like:
module DebtModels
class Foo
Path: app/models/debt_models/foo.rb
Upvotes: 3