Duane J. wrote:
When I specify the fields for searches_on, the query log shows the
SELECT * FROM foobar WHERE ((UCASE(title) LIKE ‘%SEARCHSTRING%’ OR
UCASE(name) LIKE ‘%SEARCHSTRING%’ OR UCASE(blah) LIKE
Is it causing an error because of the lack of closing parens?
Sorry, the lack of closing parens in the above query was my fault from
when I was trying to sanitize the query before posting to the public.
When the error occurs, MySQL does not even see the above search query.
It only receives the SHOW FIELDS query. The above query is received when
I specify the columns for searches_on (eg. ‘searches_on :title :name
:blah’ vs. ‘searches_on :all’)
Just to make sure we’re on the same page, I’ve attached the latest
search.rb file that I have. I think it’s slightly different from the
one you’re using, because the error wasn’t on the same line. Could
you check this one?
OK. I’m using this new ‘search.rb’, but still get an error.
My model has:
class Foobar < ActiveRecord::Base
Here is the error:
NoMethodError in Foobar#search
undefined method `validate_options’ for Foobar:Class
Application Trace | Framework Trace | Full Trace
The error is the same with or without ‘searches_on :all’ in the model
Where do you have ‘validate_options’ defined?
Matt C. Wagner
Information Security Analyst
Network Intrusion Detection
Security Operations Center
Corporate Information Security
Wells Fargo Bank