0
在我的Rails日誌以下(消毒)SQL正在對破壞運行Rails的這個更新查詢:什麼是產生
SQL (0.5ms) DELETE FROM "people" WHERE "people"."id" = $1 [["id", 345]]
SQL (0.4ms) UPDATE "people" SET position = (position - 1) WHERE ("people"."voter_registration_id" = 194 AND "people"."level" = 'state' AND position > 5)
class Person < ActiveRecord::Base
belongs_to :voter_registration, inverse_of: :people
.
.
.
end
什麼引起第二update
線被創造出來的?例如,爲什麼它會對現有人員進行重新排序(原始請求中當前刪除的人員位置是5)?
- 但現在我可以」看看爲什麼會這樣。 哪個控制器/操作調用了SQL代碼? – gernberg