I am trying to run a pair of sql statements with the second using a
value form the first’s returned data set but can figure out the syntax.
@risks returns the values I would expect but @changes gets no returned
data obvioulsy because it doesn’t see the contenst of @risks.id.
@risks = Risk.find_by_sql([“SELECT * FROM risks r where r.status =
‘Open’ and r.owner_id = ? order by r.id”, @params[‘owner’]])
@changes = Change.find_by_sql([“SELECT * FROM changes c where c.risk_id
= ? order by c.id”, @risks.id])
Any help please.