Service objects in Rails: how to find a mess
12-Oct-2023 1038
Service objects are hard. Back in days, the goal was to extract business logic from controllers and models, and, in some cases, turned out to a black hole inside app/services folder.In this post we will discuss two things that are often missing: contracts and composability. After that I will share a list of anti–patterns I found while working on dozens of Rails applications. We will examine more and less popular gems to see if they help us to avoid these bad practices. The final part is all about diagnosing your code for these problems and fixing them quickly.
Service objects in Rails: how to find a mess #ruby #rubydeveloper #rubyonrails #Service #objects #Rails: #service https://rubyonrails.ba/link/service-objects-in-rails-how-to-find-a-mess