If you have several models you want to search through in one go, one approach is to use a separate search model. First populate a database view with the models you want to search through:
Now we can write our Search model:
Search.new('awesome') will return all authors AND books that have 'awesome' in their name or title.
If you don't wish to search across all your text columns, you an include Searchable with a list of columns to whitelist in searches:
As you can see, _why can't be found.
It's also possible to limit which columns are searched through judicious use of scopes: