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

node.js - StackOverflow API not returning JSON -

python - Subclassed QStyledItemDelegate ignores Stylesheet -

php - Laravel 4.1 to Heroku: SQLSTATE[HY000] [2002] No such file or directory -