Class: Emotion

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/emotion.rb

Overview

Participants rate their emotions a name and intensity

Class Method Summary collapse

Class Method Details

.associate(participant, name) ⇒ Object



13
14
15
16
17
18
# File 'app/models/emotion.rb', line 13

def self.associate(participant, name)
  find_or_create_by(
    creator_id: participant.id,
    name: normalized_name(name)
  )
end