Closed gucki closed 12 years ago
Sorry to bother you with this, but I simply cannot find a solution to make squeel generate my desired query. Here's my code with all the scopes I tried and the exception I got (I used only one at once).
class Offer < ActiveRecord::Base def build_scope brands = [1,2,3] models = [4,5,6] scope = scoped scope = scope.where{(id.in brands) | (id.in models)} # undefined method `in' for 0:Fixnum scope = scope.where{(:id.in brands) | (:id.in models)} # undefined method `in' for :id:Symbol scope = scope.where{("id".in brands) | ("id".in models)} # undefined method `in' for "id":String scope = scope.where{{:id => brands} | {:id => models}} # Cannot visit Sequel::SQL::BooleanExpression end end
Any help would be really nice :)
Sorry, the problem was a local variable named "id". :-(
Sorry to bother you with this, but I simply cannot find a solution to make squeel generate my desired query. Here's my code with all the scopes I tried and the exception I got (I used only one at once).
Any help would be really nice :)