7 Patterns to Refactor Fat ActiveRecord Models

Early on, SRP is easier to apply. ActiveRecord classes handle persistence, associations and not much else. But bit-by-bit, they grow. Objects that are inherently responsible for persistence become the de facto owner of all business logic as well. And a year or two later you have a User class with over 500 lines of code, and hundreds of methods in it’s public interface. Callback hell ensues.
7 Patterns to Refactor Fat ActiveRecord Models #ruby #rubydeveloper #rubyonrails #activerecord https://rubyonrails.ba/single/7-patterns-to-refactor-fat-activerecord-models

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles