ruby on rails 3 - Ransack OR queries -
i want make search fields null or have value of -1 using ransack.
search({:param_name_null => 1 }) will give nulls
search({:param_name_is_any => -1 }) will give -1s
how make or between these 2 using ransack? thanks
ransack issue #290 explains queries contain 2 separate conditions need specified separately combined.
i haven't tested snippet it, or it, should work:
.search(:m => 'or', :param_name_eq => -1, :param_name_null => true)
Comments
Post a Comment