Sha256: 5d54b0cfa1aed933f99c2fcb58d8f459ef136e795578c40acc9ecf39f78cd0e0
Contents?: true
Size: 406 Bytes
Versions: 68
Compression:
Stored size: 406 Bytes
Contents
class AddEmotionIdsToOrphanedEmotionalRatings < ActiveRecord::Migration def change Participant.all.each do |participant| unless participant.emotions.empty? emotion_id = participant.emotions.first.id participant.emotional_ratings.each do |emotion_rating| emotion_rating.update!(emotion_id: emotion_id) unless emotion_rating.name end end end end end
Version data entries
68 entries across 68 versions & 1 rubygems