Add the rating column to feedbacks

This commit is contained in:
gregoirenovel 2018-08-27 12:59:22 +02:00
parent 29169b8b47
commit 4103861f90
3 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,9 @@
class Feedback < ApplicationRecord
belongs_to :user
enum rating: {
happy: 'happy',
neutral: 'neutral',
unhappy: 'unhappy'
}
end

View file

@ -0,0 +1,5 @@
class AddRatingToFeedbacks < ActiveRecord::Migration[5.2]
def change
add_column :feedbacks, :rating, :string
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2018_08_22_162952) do
ActiveRecord::Schema.define(version: 2018_08_27_102828) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -323,6 +323,7 @@ ActiveRecord::Schema.define(version: 2018_08_22_162952) do
t.integer "mark"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "rating"
t.index ["user_id"], name: "index_feedbacks_on_user_id"
end