Chapter 2. Domain Modeling

The Active Record pattern used in the ORM built into Rails was an innovation to many in the web development community. Because of Active Record, developers no longer have to specify details of the object-relational mapping in great detail, nor do they have to duplicate them in the models and the configuration files. In short, Active Record simplified things and allows developers to work faster.

In addition, the Active Record library also introduced further conventions and innovations that influence the strategy used with domain modeling in the Ruby on Rails framework. For example, has_many :through has pretty much supplanted the more traditional has and belongs to many relationships in Rails domain modeling; it successfully ...

Get Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.