Sha256: 93933ae9444ac46afdbf83b21867b0fcb371617c92dfbe9e416fe13ba927147e
Contents?: true
Size: 668 Bytes
Versions: 26
Compression:
Stored size: 668 Bytes
Contents
class Participator def self.create!(attendee_hash) event_id = attendee_hash.delete :event_id attendees = [] attendee_hash.each do |participant_class, participant_ids| participant_class = participant_class.to_s.classify.constantize if Participant.types.include?(participant_class) participant_ids.each do |participant_id| next if participant_id.blank? || participant_class.blank? attendees << Attendee.create!({ :event_id => event_id, :participant_id => participant_id, :participant_type => participant_class }) end end end attendees end end
Version data entries
26 entries across 26 versions & 1 rubygems