hasyrails / calendar-vue-original

0 stars 0 forks source link

94_schedule_color_change_inherit / カレンダーの色変更がToDoカードにも反映されるようにする #195

Open hasyrails opened 4 years ago

hasyrails commented 4 years ago

ActiveRecord::RecordNotUnique発生で更新できず?

Processing by Api::SchedulesController#color_change as JSON
16:23:48 web.1       |   Parameters: {"id"=>"1", "body"=>"fuga", "description"=>nil, "start"=>"2020-10-01", "end"=>"2020-10-03", "done"=>false, "date"=>"2020-10-01T07:09:00.000Z", "date_year"=>2020, "date_month"=>10, "date_day"=>1, "commit"=>true, "color"=>"#CBFFD3", "card_id"=>1, "created_at"=>"2020-10-24T07:09:54.660Z", "updated_at"=>"2020-10-24T07:21:14.236Z"}
16:23:48 web.1       |   Schedule Load (0.2ms)  SELECT  "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:68
16:23:48 web.1       |   Schedule Load (0.2ms)  SELECT "schedules".* FROM "schedules" WHERE "schedules"."card_id" = ?  [["card_id", 1]]
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:34
16:23:48 web.1       | Unpermitted parameters: :created_at, :updated_at, :format
16:23:48 web.1       |    (0.1ms)  begin transaction
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       |   Card Load (0.1ms)  SELECT  "cards".* FROM "cards" WHERE "cards"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       |    (0.1ms)  commit transaction
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       | Unpermitted parameters: :created_at, :updated_at, :format
16:23:48 web.1       |    (0.1ms)  begin transaction
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       |   CACHE Card Load (0.0ms)  SELECT  "cards".* FROM "cards" WHERE "cards"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       |   Schedule Update (0.7ms)  UPDATE "schedules" SET "id" = ?, "color" = ?, "date" = ?, "date_day" = ?, "updated_at" = ? WHERE "schedules"."id" = ?  [["id", 1], ["color", "#CBFFD3"], ["date", "2020-10-01 07:09:00"], ["date_day", 1], ["updated_at", "2020-10-24 07:23:48.311588"], ["id", 2]]
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       |    (0.1ms)  rollback transaction
16:23:48 web.1       |   ↳ app/controllers/api/schedules_controller.rb:36
16:23:48 web.1       | Completed 500 Internal Server Error in 11ms (ActiveRecord: 1.6ms)
16:23:48 web.1       | 
16:23:48 web.1       | 
16:23:48 web.1       |   
16:23:48 web.1       | ActiveRecord::RecordNotUnique (SQLite3::ConstraintException: UNIQUE constraint failed: schedules.id: UPDATE "schedules" SET "id" = ?, "color" = ?, "date" = ?, "date_day" = ?, "updated_at" = ? WHERE "schedules"."id" = ?):
16:23:48 web.1       |   
16:23:48 web.1       | app/controllers/api/schedules_controller.rb:36:in `block in color_change'
16:23:48 web.1       | app/controllers/api/schedules_controller.rb:35:in `color_change'