field_in overwrites field_equals. is it official and intended? #103

Open
tomash opened this Issue Jul 11, 2012 · 0 comments

1 participant

@tomash

In a site I'm developing there is an option to filter by given value, but that should also return records where this value has been left blank (as in "unspecified" / "whatever"). I've experimented with code like

if(search_params['gender_equals'])
  search_params.merge!({'gender_in' => [nil, '', search_params['gender_equals']].uniq})
end

and it works like charm, i.e. metasearch build sql query that does not have the "==" clause on this field, but has an "in" clause on it. but i just wanted to ask if it's intentional and maybe documented somewhere (i.e. suffix-precedence)?

if yes, is that behavior carried on to ransack as well? we'll be migrating soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment