{"action":"created","issue":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/897","repository_url":"https://api.github.com/repos/activerecord-hackery/ransack","labels_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/897/labels{/name}","comments_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/897/comments","events_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/897/events","html_url":"https://github.com/activerecord-hackery/ransack/issues/897","id":306252821,"node_id":"MDU6SXNzdWUzMDYyNTI4MjE=","number":897,"title":"_in predicate does not work for array attribute","user":{"login":"mirceadaniel","id":21284029,"node_id":"MDQ6VXNlcjIxMjg0MDI5","avatar_url":"https://avatars2.githubusercontent.com/u/21284029?v=4","gravatar_id":"","url":"https://api.github.com/users/mirceadaniel","html_url":"https://github.com/mirceadaniel","followers_url":"https://api.github.com/users/mirceadaniel/followers","following_url":"https://api.github.com/users/mirceadaniel/following{/other_user}","gists_url":"https://api.github.com/users/mirceadaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/mirceadaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirceadaniel/subscriptions","organizations_url":"https://api.github.com/users/mirceadaniel/orgs","repos_url":"https://api.github.com/users/mirceadaniel/repos","events_url":"https://api.github.com/users/mirceadaniel/events{/privacy}","received_events_url":"https://api.github.com/users/mirceadaniel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-18T16:01:45Z","updated_at":"2018-12-18T15:49:59Z","closed_at":null,"author_association":"NONE","body":"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[]) .\r\n\r\n```\r\nInfoData.first.error_codes \r\n=> [9,7,5]\r\n```\r\n\r\nI 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\r\n```\r\noperator does not exist: integer[] = integer\r\nLINE 1: ...ranch_id\" WHERE \"info_data\".\"error_codes\" IN (9) A...\r\n                                                         ^\r\nHINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.\r\n```\r\n                                                  \r\nIs there a way around this?\r\n"},"comment":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/comments/448267437","html_url":"https://github.com/activerecord-hackery/ransack/issues/897#issuecomment-448267437","issue_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/897","id":448267437,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODI2NzQzNw==","user":{"login":"seanfcarroll","id":11340230,"node_id":"MDQ6VXNlcjExMzQwMjMw","avatar_url":"https://avatars3.githubusercontent.com/u/11340230?v=4","gravatar_id":"","url":"https://api.github.com/users/seanfcarroll","html_url":"https://github.com/seanfcarroll","followers_url":"https://api.github.com/users/seanfcarroll/followers","following_url":"https://api.github.com/users/seanfcarroll/following{/other_user}","gists_url":"https://api.github.com/users/seanfcarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/seanfcarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanfcarroll/subscriptions","organizations_url":"https://api.github.com/users/seanfcarroll/orgs","repos_url":"https://api.github.com/users/seanfcarroll/repos","events_url":"https://api.github.com/users/seanfcarroll/events{/privacy}","received_events_url":"https://api.github.com/users/seanfcarroll/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T15:49:59Z","updated_at":"2018-12-18T15:49:59Z","author_association":"MEMBER","body":"Ransack can search Postgres arrays using a [custom predicate](https://stackoverflow.com/a/45728004/993592), this solution looks pretty good, and could be added to the Ransack core."}}
{"actor":{"display_login":"seanfcarroll"}}