has_many relation doesn't seems right or logical, some thing like belongs_to_many looks right
- by Vijendra
My situation is like this.
Company has many users and users may belongs to many companies.
And current implementation is something like below.
class Company
has_many :employments
has_many :users, :through = :employments
end
class Employment
belongs_to :company
belongs_to :user
end
class User
has_many :employments
has_many :companies, :through = :employments #This doesn't looks correct
end
User has many companies doesn't looks logically meaningful.It must be some thing like belongs_to_many companies.
Do I need to use has_and_belongs_to_many? But that also will gives the same meaning.
Can some one please suggest the right way for representing these relationships?