PG:Error when searching list containing association_id columns #1114

Open
e2 opened this Issue May 7, 2012 · 0 comments

Comments

Projects
None yet
3 participants

e2 commented May 7, 2012

When I do a search on a list of records, I get:

PG::Error: ERROR:  operator does not exist: integer ~~* unknown
LINE 1: ...ntent ILIKE '%great%') OR (comments.user_id ILIKE '%gr...

because Postgres is picky about using ILIKE on integers (user_id).

Works in sqlite of course.

The reason user_id is in the search field is my fault, because I accidentally
added field :user_id instead of :user in the RailsAdmin config block.

A fix might be to cast anything passed to ILIKE to a string to avoid crashes or
use the type definition from the DB adaptor directly. I'm not sure.

NOTE: I'm behind HEAD somewhat, so I don't know if this still applies.

Let me know if you need anything else.

mshibuya self-assigned this Mar 10, 2015

mshibuya added this to the 0.7 milestone Mar 10, 2015

@sferik sferik modified the milestone: 1.0.0, 1.1.0 Sep 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment