Add the rating column to feedbacks
This commit is contained in:
parent
29169b8b47
commit
4103861f90
3 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
class Feedback < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
||||
enum rating: {
|
||||
happy: 'happy',
|
||||
neutral: 'neutral',
|
||||
unhappy: 'unhappy'
|
||||
}
|
||||
end
|
||||
|
|
5
db/migrate/20180827102828_add_rating_to_feedbacks.rb
Normal file
5
db/migrate/20180827102828_add_rating_to_feedbacks.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddRatingToFeedbacks < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :feedbacks, :rating, :string
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue