dkubb changed the topic of #datamapper to: Datamapper v1.2.0 | Mailing List: http://is.gd/aa9D | Logs: http://is.gd/qWAL7V | DataMapper 2 Renamed to ROM, see #rom-rb for development
lgierth has quit [Quit: Ex-Chat]
mikecmpbll has quit [Quit: i've nodded off.]
danielnolan has joined #datamapper
<danielnolan>
Hello everyone, I am new to datamapper. is there a better way to write this
<danielnolan>
query = "SELECT solution_id FROM option_value_solutions WHERE option_value_id = #{selected_choices.first}"
<danielnolan>
if selected_choices.size > 1
<danielnolan>
selected_choices.each do |s|
<danielnolan>
query += " INTERSECT SELECT solution_id FROM option_value_solutions WHERE option_value_id = #{s} "