Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
create params[:q] condition with "in" predicate #175
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
seanfcarroll
May 24, 2017
Member
This issue appears more to be a HOW-TO issue rather than a bug in Ransack. We are in the process of cleaning up the Ransack gem and repo. If this issue is still relevant could you please ask it on StackOverflow?
If you think it is an issue with Ransack, please provide a repo with the issue and / or a pull request with failing tests. If you don't know how to do this, indicate it in the issue and we will look into it eventually.
Thank you
https://github.com/activerecord-hackery/ransack/blob/master/CONTRIBUTING.md
This issue appears more to be a HOW-TO issue rather than a bug in Ransack. We are in the process of cleaning up the Ransack gem and repo. If this issue is still relevant could you please ask it on StackOverflow? If you think it is an issue with Ransack, please provide a repo with the issue and / or a pull request with failing tests. If you don't know how to do this, indicate it in the issue and we will look into it eventually. Thank you https://github.com/activerecord-hackery/ransack/blob/master/CONTRIBUTING.md |
lironbeni commentedDec 12, 2012
Hi Ernie,
What I'm trying to do is to create params[:q] condition with "in" predicate that produces the following SQL code:
SELECT
cell_lines.* FROM
cell_linesWHERE
cell_lines.
idIN (9,10)
I'm inserting this to the params[:q]:
{"c"=>{"0"=>{"v"=>{"0"=>{"value"=>[9,10]}}, "p"=>"in", "a"=>{"0"=>{"name"=>"id"}}}}}
And getting the following error:
actually what I'm asking is how do I convert this:
params[:q] = {"id_in" => [9,10]}
into this:
params[:q] = {"c"=>{"0"=>{"v"=>{"0"=>{"value"=>[9,10]}}, "p"=>"in", "a"=>{"0"=>{"name"=>"id"}}}}}
so they will work the same...
Would really appreciate your help in this manner