ernie/ransack — pull request #94 by aq2-sanger (2012-05-02 07:01:03+00:00)
Title: Allow adding of custom predicates that take arrays (like IN/NOT IN)

Hi,

I realised that the changes I made to your gem and have been using on my own project might come in handy for others: as discussed here: https://github.com/ernie/ransack/issues/11

As discussed in that issue, using matches_any would do the job but cannot be indexed, whereas creating a custom predicate (like we have, called 'ci_in' or 'ci_not_in' to do case insensitive many term matching) can be indexed. We basically create an index where the terms are upper-cased, and upper-case the search terms before sending them in, and it works quite well - benchmarking proves the indexing is working as the speed is higher than using matches_any.

If you're willing to merge the changes, or provide something similar, it'd be cool. It'd also be cool if you're not, of course, it's your gem, but I thought I'd run it past you.

Thanks

Asfand Yar Qazi
Team87 HTGT
Sanger Institute