On Wed, 2013-01-30 at 14:01 +0100, [email protected] wrote:
> From: Michal Fojtik <[email protected]>
>
> - CIMI::Model::Resource moved from base.rb to separate file
> - The $select methods moved to a separate module
> - CIMI::Model::Collection helpers now extend the Base class without
> reopening it (extend CollectionMethods)
> - CIMI::Model::Base methods layout reorganized to be more readable
ACK (and pushed) This was long overdue.
One general comment: pulling things into modules that are later included
("concerns") can become quite messy over time; for example, when looking
at select_helper.rb, it's not immediately clear how that fits back into
the model objects.
For other approaches to factor out self-contained business logic, have a
look at [1] and [2] These patches make things definitely better, but I'd
be wary of pushing too many things into modules.
David
[1] http://railscasts.com/episodes/398-service-objects (behind paywall,
unfortunatley)
[2]
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/