Put chubby models on a diet with concerns - Rails
37signals.com
37signals.com
> Here’s a Dropboxed concern that we mix into just the Person model
Right. So extracting a section of code into a mixin .. and then mixing it into a single model? That's just moving the code elsewhere and using a fancy method to inject it back in! It's not cleaning up anything!
For anyone interested in practical techniques to rethink, refactor and really take the knife to your overweight models this post is a good start: http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decomp...
Looks like andreiursan just cut off a couple characters from the permalink slug, which the 37s blog ignores, to get around the duplicate submission detection.
I kind of liked the idea of extending the instances instead of including in class, to add functionality to instances instead of all objects of the class, but this keeps your model's fat, just the fat is distributed so it's not in the model's single file.