2
Active Model and Active Record
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 lifeblood 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access