I have this code:
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
and I want to know of another way to write this, or if this the most effecient way. I was thinking of a scope in the user model. Any ideas?
I would write
regularandemployeeas scopes ofUser: