6
Data Layer Abstractions
This chapter opens Part 2 of the book, in which we will talk about the particular patterns in extracting abstraction layers. As we discussed in Part 1, growing Rails applications feel too cramped within model-controller-view boundaries; introducing new abstractions allows your code to breathe freely. We start with the Rails model layer and its core component—Active Record.
In Chapter 2, Active Model and Active Record, we learned that Active Record models are, by design, responsible for representing domain objects and communicating with the persistence engine. In this chapter, we will discuss the techniques for reducing the responsibility of Active Record by introducing new abstraction layers. First, we will discuss ...
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