2

Active Models and Records

In this chapter, we will dig deeper into the model layer of web applications and how it is implemented in Rails. The model layer, in a broad sense, is where the actual business logic of the application lives. If the database is the heart of a web application, the model is its life-blood system. Thus, it requires your careful attention.

We will learn about the components Rails provides to build the model layer. First, we’ll take a quick look at a basic Active Record model and examine its responsibilities, from persistence to whatever you can imagine. Then, we’ll discuss the role of Active Model and how it could be useful on its own. Finally, we’ll talk about the phenomenon of God objects and how it relates to Active ...

Get Layered Design for Ruby on Rails Applications 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.