by toasterlovin · 8y ago · 0 comments
For more complicated queries, a pattern I have become quite fond of is making database views and then using them as the backing table for an ORM model. In Rails, at least, this gives you the best of both worlds.
It implies an architecture model where you put the business logic and type safety in the RDBMS.
It reduces the number of layers for a lot of functionalities.