I have a users model and a groups model.
A user has_and_belongs_to_many :groups
and a group has_and_belongs_to_many :users
.
The associations and join tables work correctly.
A group can only have one user who owns the group, I want to name be able to call @group.owner
to return the user that owns the group but am unsure of how to do it, I've created a user references column on the Group table rails g migration add_user_to_groups user:references
but I don't know what to put in the Group model, something like has_one :user, as: :owner
Is this the correct way to do it?