Rails 2.3.8 Compound condition
- by Michael Guantonio
I have a rails query that I would like to run. The only problem that I am having is the query structure.
Essentially the query looks like this
queryList = model.find(:all, :conditions => [id = "id"])
#returns a query list
#here is the issue
compound = otherModel.find(:first, :select => "an_id",
:conditions => ["some_other_id=? and an_id=?, some_other_id, an_id])
Where an_id is actually a list of ids in the query list. How can I write that in rails to basically associate a single id to a list that may contain ids...