Rails Anti-Patterns?
In this chapter, we will touch on the hot topic of the Rails way controversy. Being almost a 20-year framework, Ruby on Rails has gotten its portion of criticism (it’s doubtful that software used by millions would get only positive feedback). We select the most debated Rails features and discuss how to make friends (not foes) with them. We will start by discussing Action Controller and Active Record callbacks. Then, we will move on to Rails concerns. Finally, we look at different examples of using global state in Rails applications.
We will cover the following topics:
- Callbacks, callbacks everywhere
- Concerning Rails concerns
- On global and current states
This chapter teaches you how to use these debated techniques mindfully and what alternatives to consider when an application outgrows the Rails way. From the perspective of layered architecture, the considered features can quickly turn into anti-patterns, since they tend to cross...