I use active_admin and bring meta_search to my project. (Which I do not want to use for anything else).
It seems that the definition of the search method on all my models, which then means when I turn on the tires, I can not use its search method.
There seems to be something strange in the way he defines a method as well - method_defined? says the search method is not defined, but when I call it, I get meta_search. Even if I define my own search method in the class when I call Document.search, I still get meta_search.
EDIT: I would be interested in general ways to solve this kind of thing. I solved this problem with Model.tire.search (since the bus is also available that way), but I still hate that the gem I donโt even use can force me to use the workaround in the rest of my project.
EDIT: I don't know how to include code in the answers, so I will put this here.
1.9.3p125 :001 > require "tire"
1.9.3p125 :002 > Document.send(:include, Tire::Model::Search)
=> Document(...)
1.9.3p125 :003 > Document.search
Document Load (2.1ms) SELECT "documents".* FROM "documents"
1.9.3p125 :001 > Document.search
1.9.3p125 :002 > require "meta_search"
1.9.3p125 :003 > Document.search
1.9.3p125 :001 > require "meta_search"
1.9.3p125 :002 > Document.search
Document Load (1.8ms) SELECT "documents".* FROM "documents"
Loading production environment (Rails 3.2.2)
1.9.3p125 :001 > require "meta_search"
=> true
1.9.3p125 :002 > Document.search
My interpretation of this is that there is an error related to the way meta_search detects that a search is already defined when the class is not actually loaded. Hooray!
source
share