-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Is present and Is blank filter #1099
Comments
Merging this into #1114. |
Part of this issue is related to 1114, but not the boolean part. The fact is that the filter on boolean columns includes the is present and is blank entries on the list, but they cause a postgres error. |
I know it, of course :) |
The issue still exists in rails_admin/adapters/active_record.rb:
The line with '_present' leads to the postgres error:
Reason: a column of type boolean is compared with an empty string. |
I can also replicate this issue. I may end up removing the options with JS which is a pretty dirty and unfortunate hack. |
This is still relevant in |
This error still exists. please reopen the issue. |
also still having the issue with |
No fix yet? Same issue exists with 0.8.1 |
Filtering a boolean field on "Is present" or "Is blank" produces SQL that includes checking against an empty string. Since a boolean field can only be true, false, or null, this causes errors in some databases. This commit removes the empty string search for boolean field types.
Filtering a boolean field on "Is present" or "Is blank" produces SQL that includes checking against an empty string. Since a boolean field can only be true, false, or null, this causes errors in some databases. This commit removes the empty string search for boolean field types.
…ng_on_boolean_columns Issue #1099: Filtering on "Is present" and "Is blank" on boolean columns
Apologies in advance I'm quite new to rails and rails_admin.
Seem like the 'Is Present' and 'Is blank' column filters fail for any boolean value
It also fails when checking against the integer value of a FK object.
To better explain: I have a relationship between Client and Appointment, in my appointment list I include the field :client <-- where some automagick seems to display the clients name and create a link to that object. I can use all the other filters on the :client field just fine but if i try and check on Is Present or Is Blank the sql generated seems to try and check if client_id is not null and client_id != '' <-- which I believe is the issue.
Thanks!
The text was updated successfully, but these errors were encountered: