I've been trying to set up a group functionality on a rails app, but I'm having some issues with organizing the structure. So what I would like to achieve is to let user create a group and then invite other users to this group possibly just simply via sharing a link to it. The hard part is to be able to only let users whom which the link has been shared to join the group. So far I've came up with a user model
class User < ApplicationRecord has_many :groupsend
and a simple group model as
class Group < ApplicationRecord belongs_to :userend
Now I'm wondering do I need another layer here such as memberships or invitations to be able to achieve what I'm after?