Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. class Session < ApplicationRecord
  2. has_many :attendees
  3.  
  4. def owner
  5. self.attendees.each do |attendee|
  6. if attendee.role == "Owner"
  7. "#{attendee.user_id}"
  8. end
  9. end
  10. end
  11.  
  12. end
  13.  
  14. class Attendee < ApplicationRecord
  15. belongs_to :session
  16.  
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement