ernie/ransack — pull request #305 by jerodsanto (2013-11-15 21:02:42+00:00)
Title: Fix `search` method name clash with other libraries

I kept running in to method name clashes when using Ransack and [ThinkingSphinx](https://github.com/pat/thinking-sphinx) on the same app. They both define a `search` method and I was calling Ransack's when I really wanted TS's.

Then I noticed that Ransack *should be* accounting for this and not aliasing when AR::Base already has a `search` method defined.

Unfortunately, `method_defined?` returns false here even though TS has already been included in to AR::Base. I'm not sure why (in fact, `method_defined?` even returns false after Ransack is included and aliases itself).

Switching the call to `respond_to?` fixes the problem and the test suite is green. I didn't add a specific test for this because I'm not sure how to test whether or not an alias to a method exists.

I'm happy to add a test with some guidance on how to accomplish it.