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]
https://discuss.rubyonrails.org/t/helping-devs-understand-concerns-faster/74619/22?u=software_writer
To read: https://codeclimate.com/blog/7-ways-to-decompose-fat-activerecord-models/ https://reactjs.org/blog/2016/07/13/mixins-considered-harmful.html https://www.rubypigeon.com/posts/rails-models-bloated-should-i-use-concerns/ https://www.cloudbees.com/blog/when-to-be-concerned-about-concerns
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”
Recent posts:
Master Git tools - Effective Programmer pt. 2
Learn about the importance of writing a good commit messages. How to use message templates, hooks, aliases and how to navigate Git history like a pro.
Read More
Taking notes for productivity - Effective Programmer pt. 1
Organizing knowledge is a key factor of effective programming work. Is taking notes the perfect way to do it? I think yes answering all of the why and how questions.
Read More
How to deploy multiple Rails apps on a single server with Capistrano
Almost everyone uses cloud hosting solutions like Heroku or AWS nowadays(and I don’t expect it to change even after this DHH post). But if you still self-host your apps then Capistrano would be well known to you.
Read More
Master Git tools - Effective Programmer pt. 2
Taking notes for productivity - Effective Programmer pt. 1
How to deploy multiple Rails apps on a single server with Capistrano
Almost everyone uses cloud hosting solutions like Heroku or AWS nowadays(and I don’t expect it to change even after this DHH post). But if you still self-host your apps then Capistrano would be well known to you.