sql - Rails, squeel - loop inside 'where' -


i want use sort of loop or iterator inside statement like

product.where{ array.each |e|   (id >= e[0]) & (id <= e[1]) end } 

is possible?

in reality query more complicated, , don't want post whole architecture here.

product.where('id >= ? , id <= ?',array[0],array[1]) 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -