Tag: meta where

想要在Rails 3中find没有关联logging的logging

考虑一个简单的关联… class Person has_many :friends end class Friend belongs_to :person end 让所有在ARel和/或meta_where中没有朋友的人最干净的方法是什么? 然后呢怎么样has_many:通过版本 class Person has_many :contacts has_many :friends, :through => :contacts, :uniq => true end class Friend has_many :contacts has_many :people, :through => :contacts, :uniq => true end class Contact belongs_to :friend belongs_to :person end 我真的不想使用counter_cache – 而我从我读过的东西不能用has_many:通过 我不想拉所有的person.friendslogging,并在Ruby中通过它们循环 – 我想有一个查询/范围,我可以使用meta_searchgem 我不介意查询的性能成本 而离实际的SQL越远越好…