Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Session < ApplicationRecord
- has_many :attendees
- def owner
- self.attendees.each do |attendee|
- if attendee.role == "Owner"
- "#{attendee.user_id}"
- end
- end
- end
- end
- class Attendee < ApplicationRecord
- belongs_to :session
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement