我有三个模型
class Collection < ActiveRecord::Base
has_many :presentations
has_many :galleries, :through => :presentations
end
class Gallery < ActiveRecord::Base
has_many :presentations
has_many :collections, :through => :presentations
end
class Presentation < ActiveRecord::Base
belongs_to :collection
belongs_to :gallery
end
如何获取所有不属于给定画廊的集合?
我的SQL知识很基础。我还想让Rails(2.3)不使用显式的SQL表达式完成这项工作。