-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with paranoia gem #223
Comments
https://github.com/jbox-web/ajax-datatables-rails/blob/600c0de52c7f9f5c093d18a9532ae80e1d0f2456/lib/ajax-datatables-rails/base.rb#L40/ |
thanks @ajahongir I use:
and work perfect. Thanks |
This is weird because the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: