<aside> 📌 Active Record + Associated Objects = 🚀
</aside>
GEM LINK: https://github.com/kaspth/active_record-associated_object
Forewords by Roland from rubyconfth.com/
My first Rails contract was at a large corporation. While it was a great learning experience, I was confused by the approach.
The codebase was filled with Dry RB, contracts, service objects, and monads.
That was not what I was used to and made Rails feel reduced to routing logic into service objects. It ultimately became the "junk drawer" for business logic.
But there's a better way: models should represent behavior, not just data.
Domain concepts like billing can be modeled to include both data structure AND business logic.
So I now do:
user.rb
⇒ your tableuser/billing.rb
| user/mention.rb
⇒ the logic involved, i.e.: your “logic” models