ScopeOptions delegates sanitize_sql_array to ActiveRecord::Base. In Rails 3.1, this is a protected method, and causes deprecation warnings:
DEPRECATION WARNING: Using Module#delegate to delegate to non-public methods is deprecated. Please declare your methods as public if they are going to accessed from other classes. (called from /Users/bkerley/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg_search-0.2/lib/pg_search/scope_options.rb:7)
These warnings add considerable noise to tests in my Rails application, and I'd like to figure out the best way to fix this.
Are there any better solutions than these?
Long term I'd like to figure out how to use ARel to generate all of our SQL, so any solution that takes advantage of ARel would be preferred. But that's a pretty big refactor.
I'm leaning towards using send for the time being.
Well... Rails 4 does not allow delegating to protected methods at all, so it is basically broken.
I have monkey patched it this way:
I think this should be merged because soon people will start migrating to Rails 4. If you want, I can send a pull request with this change.
I just merged #87 which works around it in a different way. I'm still going to work towards removing all calls to sanitize_sql_array by preferring Arel to SQL strings.