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
Post a Comment