Displaying 1 result from an estimated 1 matches for "has_compani".
Did you mean:
has_companies
2008 May 29
7
when is a boolean not a boolean?
...ass created using the restful_authentication plugin
A Company class (has lots of fields not really important to the
problem below)
Users can have many companies, entered into the User.rb model as one
would expect
has_many: :companies
In the User.rb model I''ve also added:
def has_companies?
!companies.empty?
end
..and..
def company_count
companies.size
end
so I can easily find out if they actually have any companies and how
many companies they have. Pretty straight-forward, right?
I create users, every thing looks fine; I ask the user if it has any
companies...