diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index d03d7a0..c5daa34 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -15,7 +15,7 @@ def json_attributes methods: [:full_name], include: { tasks: { - only: [:name, :priority], + only: [:name, :priority, :duration], } }, } diff --git a/db/migrate/20230111154617_add_duration_to_task.rb b/db/migrate/20230111154617_add_duration_to_task.rb new file mode 100644 index 0000000..23eb384 --- /dev/null +++ b/db/migrate/20230111154617_add_duration_to_task.rb @@ -0,0 +1,5 @@ +class AddDurationToTask < ActiveRecord::Migration[6.1] + def change + add_column :tasks, :duration, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 2518478..ec19a35 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_01_11_142035) do +ActiveRecord::Schema.define(version: 2023_01_11_154617) do create_table "people", force: :cascade do |t| t.string "first_name" @@ -28,6 +28,7 @@ t.integer "person_id", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.integer "duration" t.index ["person_id"], name: "index_tasks_on_person_id" end