0
는이 코드가 있습니다Ruby on Rails에 이것을 쓰는 또 다른 방법이 있습니까?
class Company < ActiveRecord::Base
has_many :users, :through => :company_users do
def regular
where('regular_user = ?', true)
end
def employee
where('regular_user = ?', false)
end
end
을하고 나는이 쓰기, 또는이 경우 가장 effecient 방법은 다른 방법을 알고 싶습니다. 나는 사용자 모델의 범위를 생각하고 있었다. 어떤 아이디어?
http://codereview.stackexchange.com이 더 나은 곳이 될 것입니다. –