{"action":"created","issue":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/548","labels_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/548/labels{/name}","comments_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/548/comments","events_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/548/events","html_url":"https://github.com/activerecord-hackery/ransack/issues/548","id":86539535,"number":548,"title":"Bad query when model acts_as_nested_set ( awesome_nested_set gem )","user":{"login":"devtoro","id":5725431,"avatar_url":"https://avatars.githubusercontent.com/u/5725431?v=3","gravatar_id":"","url":"https://api.github.com/users/devtoro","html_url":"https://github.com/devtoro","followers_url":"https://api.github.com/users/devtoro/followers","following_url":"https://api.github.com/users/devtoro/following{/other_user}","gists_url":"https://api.github.com/users/devtoro/gists{/gist_id}","starred_url":"https://api.github.com/users/devtoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtoro/subscriptions","organizations_url":"https://api.github.com/users/devtoro/orgs","repos_url":"https://api.github.com/users/devtoro/repos","events_url":"https://api.github.com/users/devtoro/events{/privacy}","received_events_url":"https://api.github.com/users/devtoro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-09T10:14:00Z","updated_at":"2015-07-10T12:08:02Z","closed_at":"2015-07-10T12:08:02Z","body":"Hello! \r\n\r\nI have a model ( Organization ) and I use the awesome_nested_set gem to give a \"tree\" functionality. I want to search my model, based on the parent_name field, using ransack. After a lot of searching, I decided to use a ransacker in order to accomplish that. The ransacker is the following: \r\n\r\nransacker :parent_name, formatter: proc { |searching_name|\r\n    where( name: searching_name )\r\n    .map{ |org| org.id }.uniq\r\n    } do |organization|\r\n    organization.table[ :parent_id ]\r\n  end\r\n\r\nThe query executed is the following:\r\n\r\n\"SELECT `organizations`.* FROM `organizations`  WHERE (`organizations`.`parent_id` LIKE 0)\"\r\n\r\nHere is the ransack I execute:\r\n\r\nransack( {:parent_name_cont=>\"Crypteia\", :m=>\"or\"}  )\r\n\r\nHow am I supposed to do this with ransack? I am stuck.. I am using ransack for all the other filters in my application, so I don't want to use custom queries or something else."},"comment":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/comments/120396562","html_url":"https://github.com/activerecord-hackery/ransack/issues/548#issuecomment-120396562","issue_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/548","id":120396562,"user":{"login":"jonatack","id":2415484,"avatar_url":"https://avatars.githubusercontent.com/u/2415484?v=3","gravatar_id":"","url":"https://api.github.com/users/jonatack","html_url":"https://github.com/jonatack","followers_url":"https://api.github.com/users/jonatack/followers","following_url":"https://api.github.com/users/jonatack/following{/other_user}","gists_url":"https://api.github.com/users/jonatack/gists{/gist_id}","starred_url":"https://api.github.com/users/jonatack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonatack/subscriptions","organizations_url":"https://api.github.com/users/jonatack/orgs","repos_url":"https://api.github.com/users/jonatack/repos","events_url":"https://api.github.com/users/jonatack/events{/privacy}","received_events_url":"https://api.github.com/users/jonatack/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T12:08:02Z","updated_at":"2015-07-10T12:08:02Z","body":"Hi @devtoro - This is a duplicate of previous issues for which I have provided a workaround. Have a look :) all best"}}