私には、Customer
各顧客が多くの仕事をしているモデルがあります。
class Customer < ActiveRecord::Base
has_many :jobs
end
class Job < ActiveRecord::Base
belongs_to :customer
def self.unbilled
finished.uninvoiced # these are other scopes on Job
end
end
Customer
未請求の仕事をしているすべての顧客のリストを返すスコープを定義するにはどうすればよいですか?