Skip to content

Instantly share code, notes, and snippets.

@r38y
Created March 11, 2009 00:21
Show Gist options
  • Save r38y/77218 to your computer and use it in GitHub Desktop.
Save r38y/77218 to your computer and use it in GitHub Desktop.
def add_organizer(user)
raise ArgumentError unless user.is_a?(User)
part = participations.new
part.user = user
part.organizer = true
part.save!
end
def add_speaker(user)
raise ArgumentError unless user.is_a?(User)
part = participations.new
part.user = user
part.speaker = true
part.save!
end
def add_participant(user)
raise ArgumentError unless user.is_a?(User)
participants << user unless has_participant?(user)
end
def has_participant?(user)
raise ArgumentError unless user.is_a?(User)
participants.include?(user)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment