RE: Help with TextSearch :all and MySQL


#1

Duane,

When I comment-out the ‘validate_options’ lines in self.search, it
works.

I’m relieved! :slight_smile:

The ‘validate_options’ should still be fixed. But at least it works with
‘searches_on :all’ or without it.

After the ‘validate_options’ problem is solved, it would be good to
please update the ‘search.rb’ code on the Rails wiki:

http://wiki.rubyonrails.com/rails/pages/TextSearch

Thank you very much for your help!

Matt

Wagner, Matt C. wrote:

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/bas
e.rb:991:in

method_missing' #{RAILS_ROOT}/lib/search.rb:50:insearch’
#{RAILS_ROOT}/app/controllers/foobar_controller.rb:58:in `search’

The error is the same with or without ‘searches_on :all’ in the model
file.

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


#2

On Jan 6, 2006, at 12:09 PM, removed_email_address@domain.invalid
removed_email_address@domain.invalid wrote:

Wagner, Matt C. wrote:

Where do you have ‘validate_options’ defined?
Hi Matt,

Thanks for your patience with this. I’m working from an older code
base (Rails 0.13) and so there are some differences I didn’t expect.

It turns out that validate_options is now part of the Hash class:
http://dev.rubyonrails.org/changeset/2167

So you should be able to replace that call with
options.assert_valid_keys(:keys, :go, :here)

I’ll update the wiki. Thanks!

Duane J.
(canadaduane)
http://blog.inquirylabs.com/