You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
did anyone have a simpler solution for this? I'd like to match array to *_in across multiple ids, so if a has_many association contains both X_ID && Y_ID
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[]) .
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
Is there a way around this?
The text was updated successfully, but these errors were encountered: