Skip to content

PG:Error when searching list containing association_id columns #1114

@e2

Description

@e2

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions