demarches-normaliennes/app/models/feedback.rb
2020-08-18 15:57:36 +02:00

21 lines
459 B
Ruby

# == Schema Information
#
# Table name: feedbacks
#
# id :bigint not null, primary key
# rating :string not null
# created_at :datetime not null
# updated_at :datetime not null
# user_id :bigint
#
class Feedback < ApplicationRecord
belongs_to :user, optional: false
enum rating: {
happy: 'happy',
neutral: 'neutral',
unhappy: 'unhappy'
}
validates :rating, presence: true
end