Assuming:
class Person < ActiveRecord::Base
scope :domestic, ->(countries) { where(country: countries) }
def self.ransackable_scopes(auth_object=nil); [:domestic]; end
end
Trying to filter by a list of countries:
Person.search(country: ['US', 'JP'])
Will raise ArgumentError: wrong number of arguments (2 for 1)
Again, we are able to format the input in order to avoid this.
Person.search(country: [['US', 'JP']])
This avoids the issue as it seems to be a problem with splatting the args.
Assuming:
Trying to filter by a list of countries:
Will raise
ArgumentError: wrong number of arguments (2 for 1)Again, we are able to format the input in order to avoid this.
This avoids the issue as it seems to be a problem with splatting the args.