TL,DR; When building an application using Rails, I prefer to keep all my
app/models/. I reserve
lib/ for those other things - those
not-my-domain-things. I’d like to explain the what and why.
Rails has a history of co-opting names, as happened when the
library used the active record pattern name. A similar
co-opting has happened with the MVC pattern wherein many believe
Rails is an example of the MVC design pattern. In truth, it’s probably closer
to MVC Model 2… but I digress.
Model View What’s-that-now?
MVC stands for Model, View, Controller. In Rails-land we know what the Controllers are. And while we don’t have Views in the way that MVC meant, we do have view-templates, and we call those our views. The Model is meant to be all the things it takes to model our problem domain. As applied to Rails, the Model seems the most misunderstood/misused of the MVC triumvirate.