class Game < ActiveRecord::Base
has_many :game_types, :dependent => :destroy
has_many :types, :through => :game_types
end
class Type < ActiveRecord::Base
has_many :game_types, :dependent => :destroy
has_many :games, :through => :game_types
end
Game Type 1 == Single Player Game Type 2 == Multiplayer
How can I query for Games that have either type IDs 1 OR 2 OR both?
Additionally, how can I query for Games that have neither?
This is being used with pagination via will_paginate so single queries would be preferable.
Thank you in advance for rescuing my sanity.