I'm using squeel
and I'm getting a ActiveRecord::QueryMethods::WhereChain
returned from a query rather than an ActiveRecord::AssociationRelation
.
Query:
game.golfers.where{competitors.swing_golfer IS DISTINCT FROM TRUE}
Query that returns AssociationRelation
game.golfers.where{"competitors.swing_golfer IS DISTINCT FROM TRUE"}
Notice the quotes change the return type.
Models
class Game < ActiveRecord::Base
has_many :competitors
has_many :golfers, through: :competitors
end
class Golfer < ActiveRecord::Base
has_many :competitors
has_many :games, through: :competitors
end
Any idea what this ActiveRecord::QueryMethods::WhereChain
is and how I can use it or avoid it?
- ruby 2.0.0
- rails 4.0
- squeel 1.1.1