[ActiveRecord] scope for collection associations

Love the idea!

It clearly separates the concerns of the two models.

One thing though, would it be interesting for the scope to take and array of scopes?

I don’t think that multiple scopes would add any real value. Scopes can themselves be chains of scopes:

def recent

visible.where(‘created_at >= ?’ Time.now)


Yeah, you’re right. Makes perfect sense.

I really like the approach.