I have a Rails model call InfoData and it has an attribute called error_codes. The codes are stored in an array like so [9,7,10,21] (integer[]) .
InfoData.first.error_codes
=> [9,7,5]
I try to use ransack on it in order to search if a specific code is present(via a select option). For error_codes_in (_in ransack predicate) I receive the following error
operator does not exist: integer[] = integer
LINE 1: ...ranch_id" WHERE "info_data"."error_codes" IN (9) A...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Is there a way around this?
Ransack can search Postgres arrays using a custom predicate, this solution looks pretty good, and could be added to the Ransack core. Related
Is there a community member willing to implement a new predicate as described above?
Most helpful comment
Ransack can search Postgres arrays using a custom predicate, this solution looks pretty good, and could be added to the Ransack core. Related