0
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
游戏类型1 ==单人 游戏类型2 ==多人导轨的has_many或查询
我如何可以查询有两种类型ID 1或2或两个游戏?
此外,我如何查询既没有?
这是通过will_paginate与分页使用,所以单个查询将是可取的。
预先感谢您拯救我的理智。
非常好 - 谢谢。 – pglombardo 2012-07-16 15:58:03