You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call really_destroy! I expect it to directly remove the record from database but instead it updates the deleted_at then remove it from the database.
I believe there's no need to update the data before deleting it.
here are the logs
User Update (0.6ms) UPDATE "users" SET "deleted_at" = $1, "updated_at" = $2 WHERE "users"."id" = $3 [["deleted_at", "2018-09-06 05:24:19.366120"], ["updated_at", "2018-09-
06 05:24:19.366179"], ["id", 15]]
↳ app/use_cases/use_case/user/deactivate.rb:11
User Destroy (1.4ms) DELETE FROM "users" WHERE "users"."id" = $1 [["id", 15]]
The text was updated successfully, but these errors were encountered:
this is specially troublesome when you have a has_many :foos, dependent: :restrict_with_error
once you use really_destroy! it'll fail but the timestamp will be wrongfully touched (just happened to me)
as an ugly workaround I'm first checking:
When I call really_destroy! I expect it to directly remove the record from database but instead it updates the deleted_at then remove it from the database.
I believe there's no need to update the data before deleting it.
here are the logs
User Update (0.6ms) UPDATE "users" SET "deleted_at" = $1, "updated_at" = $2 WHERE "users"."id" = $3 [["deleted_at", "2018-09-06 05:24:19.366120"], ["updated_at", "2018-09-
06 05:24:19.366179"], ["id", 15]]
↳ app/use_cases/use_case/user/deactivate.rb:11
User Destroy (1.4ms) DELETE FROM "users" WHERE "users"."id" = $1 [["id", 15]]
The text was updated successfully, but these errors were encountered: