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
Debugging I found the problem was the agrupation of AS foo and the paranoia where clause deleted_at IS NULL. here is the problem query:
SELECT COUNT(*) FROM (SELECT "tips".* FROM "tips" INNER JOIN "tip_levels" ON "tip_levels"."id" = "tips"."tip_level_id" WHERE "tips"."deleted_at" IS NULL) AS foo WHERE "tips"."deleted_at" IS NULL)
My workaround was disable the default deleted_at IS NULL and change the get_raw_records function like this
def get_raw_records
Tip.without_deleted.joins( :tip_level )
end
The problem is I have to change all part where I query Tip and add without_deleted.
My question is: is there a solution? I think if exist an easy way of overwrite datatable count method I can solve my problem
(sorry my poor english)
The text was updated successfully, but these errors were encountered:
I am working with gems
Paranoia is for soft-delete, in my case I use in
Tip
. With this by default all query toTip
add adeleted_at IS NULL
where clauseMy datatable work perfect until implement paranoia, here is my code
Debugging I found the problem was the agrupation of
AS foo
and the paranoia where clausedeleted_at IS NULL
. here is the problem query:SELECT COUNT(*) FROM (SELECT "tips".* FROM "tips" INNER JOIN "tip_levels" ON "tip_levels"."id" = "tips"."tip_level_id" WHERE "tips"."deleted_at" IS NULL) AS foo WHERE "tips"."deleted_at" IS NULL)
My workaround was disable the default
deleted_at IS NULL
and change theget_raw_records
function like thisThe problem is I have to change all part where I query
Tip
and addwithout_deleted
.My question is: is there a solution? I think if exist an easy way of overwrite datatable count method I can solve my problem
(sorry my poor english)
The text was updated successfully, but these errors were encountered: