News for hackers. Stuff that matters.
Re:Taming Large Rails Applications with Private ActiveRecord... by mosselman on Monday November 18, 2019 @03:26PM (#21567833)
I agree. It just makes it harder to reason about what is going on and what will happen when you call methods.

A far better approach is to put related methods in concerns. When you do this based on features, lets say a concern called "SyncToTrello" that contains all the methods on lets say a "Task" model that are related to syncing to Trello. So when I have to refactor or debug the sync, I just open up the concern and look at the handful of methods that are related to just that. Rather than having to scroll through a 500+ loc Task model.

Using concerns has been a great way to tackle growth in our Rails application.

There are no comments on this comment yet.