:
has_many :events
has_many :events
I did this in the past and did ...
User
has_many :invites, dependent: :destroy
has_many :invited_events, through: :invites, source: :event
Event
has_many :invites, dependent: :destroy
has_many :invitees, through: :invites, source: :user
Invite
belongs_to :event
belongs_to :user
Then, in the invitation table, attach a boolean column for creatorto see if this user created this event. You can also add a column to show whether the user accepted the invitation or not (to show participation).
Clean and simple has_many through ... not complicated =)
source
share