Refactor Rails models using Concerns

Rails developers like to repeat some phrase like “Convetion Over Configuration”, “Fat Model, Skinny Controller” or “Don’t Repeat Yourself”. Today I am going to focus on the last one: how we can minimze the repeated code in your models using Concerns.

[Here write more about concerns]

To read:

Questions from forum: “What do you get by extending ActiveSupport::Concern?” “Why is there a different name in rails for a mixins?” “When are we using concerns”

Written on April 10, 2022

Recent posts: