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`.
Merge pull request #373 from patbenatar/fix/rails-4.1-has-many-association

Fixes has_many conditions in Rails 4.1