{"action":"created","issue":{"url":"https://api.github.com/repos/coopdevs/timeoverflow/issues/399","repository_url":"https://api.github.com/repos/coopdevs/timeoverflow","labels_url":"https://api.github.com/repos/coopdevs/timeoverflow/issues/399/labels{/name}","comments_url":"https://api.github.com/repos/coopdevs/timeoverflow/issues/399/comments","events_url":"https://api.github.com/repos/coopdevs/timeoverflow/issues/399/events","html_url":"https://github.com/coopdevs/timeoverflow/pull/399","id":350180940,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4MDkzNTc5","number":399,"title":"Re-implement the member_uid searcher","user":{"login":"markets","id":576701,"node_id":"MDQ6VXNlcjU3NjcwMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/576701?v=4","gravatar_id":"","url":"https://api.github.com/users/markets","html_url":"https://github.com/markets","followers_url":"https://api.github.com/users/markets/followers","following_url":"https://api.github.com/users/markets/following{/other_user}","gists_url":"https://api.github.com/users/markets/gists{/gist_id}","starred_url":"https://api.github.com/users/markets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markets/subscriptions","organizations_url":"https://api.github.com/users/markets/orgs","repos_url":"https://api.github.com/users/markets/repos","events_url":"https://api.github.com/users/markets/events{/privacy}","received_events_url":"https://api.github.com/users/markets/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-13T20:26:29Z","updated_at":"2018-08-15T14:04:32Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/coopdevs/timeoverflow/pulls/399","html_url":"https://github.com/coopdevs/timeoverflow/pull/399","diff_url":"https://github.com/coopdevs/timeoverflow/pull/399.diff","patch_url":"https://github.com/coopdevs/timeoverflow/pull/399.patch"},"body":"Re-implement the member_uid searcher by avoiding the column casting thing (gives some problems when sorting the \"casted\" column as an string). The new strategy: combine both fields in the controller by manupilating the query parameters sent to Ransack.\r\n\r\nCloses #398."},"comment":{"url":"https://api.github.com/repos/coopdevs/timeoverflow/issues/comments/413207775","html_url":"https://github.com/coopdevs/timeoverflow/pull/399#issuecomment-413207775","issue_url":"https://api.github.com/repos/coopdevs/timeoverflow/issues/399","id":413207775,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzIwNzc3NQ==","user":{"login":"markets","id":576701,"node_id":"MDQ6VXNlcjU3NjcwMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/576701?v=4","gravatar_id":"","url":"https://api.github.com/users/markets","html_url":"https://github.com/markets","followers_url":"https://api.github.com/users/markets/followers","following_url":"https://api.github.com/users/markets/following{/other_user}","gists_url":"https://api.github.com/users/markets/gists{/gist_id}","starred_url":"https://api.github.com/users/markets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markets/subscriptions","organizations_url":"https://api.github.com/users/markets/orgs","repos_url":"https://api.github.com/users/markets/repos","events_url":"https://api.github.com/users/markets/events{/privacy}","received_events_url":"https://api.github.com/users/markets/received_events","type":"User","site_admin":false},"created_at":"2018-08-15T14:04:32Z","updated_at":"2018-08-15T14:04:32Z","author_association":"MEMBER","body":"Hi @mllocs, I'll try to explain this ... :sweat_smile: \r\n\r\nIn current `develop` if you remove the `ransacker` (which makes the cast from integer to string), and you try to use the search feature it gives you this error:\r\n\r\n```\r\nPG::UndefinedFunction - ERROR:  operator does not exist: integer ~~* integer\r\nLINE 1: ....\"email\" ILIKE '%asd%') OR \"members\".\"member_uid\" ILIKE 0)  ...\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\nSeems like `postgresql` doesn't support `ILIKE` filters over integer columns. So, in a first try, I implemented a `ransacker` to make a cast, but then this `ransacker` is used by Ransack also in the `sort_link` helper, so now it sorts the list \"alphabetically\" by a string :(\r\n\r\nIn summary, this new solution consists of: copy value from original `_cont` param to a new `_eq` param (`_eq` works for integers, since it doesn't use `ILIKE` under the hood), and combine them with `OR` before sending this params to Ransack."}}
{"actor":{"display_login":"markets"}}