has_one and has_many in same model. How does rails track them?
I a little confused about how this work even if it works properly. I have a model that has two association to the same other model. Company has an owner and company has many employees of the class users. here is my company model: class Company < ActiveRecord::Base validates_presence_of :name has_many :employee, :class_name => 'User' has_one :owner, :class_name => 'User' accepts_nested_attributes_for :owner, :allow_destroy => true end here is my user model: class User < ActiveRecord::Base include Clearance::User attr_accessible :lastname, :firstname #other attr are whitelisted in clearance gem