Fixes has_many conditions in Rails 4.1

Rails 4.1 passes the association into the scope lambda, not the class. Rather, the associated object's class is available within the context of the lambda as `model`.

Rails 4.0 must have done this differently, or the original code never would have worked.. I haven't had a chance to test my change on 4.0 yet, so while it's confirmed to work on 4.1 it may be breaking 4.0. If that's the case, we could add another version condition here—but I wonder if there's a better way...

Perhaps someone else can help test on 4.0?