pat / thinking-sphinx-raspell

An add-on gem for spelling suggestions in Thinking Sphinx
http://pat.github.io/thinking-sphinx
MIT License
58 stars 11 forks source link

Thinkingsphinx undefining all the methods after the include #1

Closed moski closed 13 years ago

moski commented 15 years ago

I've tried using the gem but whenever i tried any of the function i was getting a strange error "NameError: superclass method `method_missing' disabled" ... after a little investigating i found that thinking sphinx undefine all the extra methods he doesn't need

search.rb

instance_methods.select { |method| method.to_s[/^__/].nil? && !CoreMethods.include?(method.to_s) }.each { |method| undef_method method } commenting out the line (undef_method method) solved the issue.

pat commented 15 years ago

Thinking Sphinx undefines those methods to allow for the Search object to act like an Array (so normal methods fall through to method_missing). If you remove that undef_method line, then search results might not always work.

Can you share the stacktrace (perhaps in a gist or pastie) of the error you've mentioned?

pat commented 13 years ago

Closing this, as it has laid dormant for over a year.