On Feb 16, 11:55 am, Christian Rishøj <[email protected]> wrote:
> > Although, as I'm writing this... perhaps what we want to do is only
> > include the search method if an index is defined for that model (or a
> > superclass)? That means it'll be there when needed, but otherwise it's
> > kept out of sight.
>
> > I'll try to code that up, but patches are welcome if you want to try
> > to beat me to it :)
>
> Here's my stab at it:http://github.com/crishoj/thinking-sphinx/tree/master
Hmm. While this change did solve the clash on method name,
ActiveRecord's compute_type for "Search" still returns
ThinkingSphinx::ActiveRecord::Search instead of my model:
>> ActiveRecord::Base.send :compute_type, 'Search'
=> ThinkingSphinx::ActiveRecord::Search
This is because compute_type relies on class_eval:
>> ActiveRecord::Base.class_eval 'Search'
=> ThinkingSphinx::ActiveRecord::Search
Possible solutions?
- Rename ThinkingSphinx::ActiveRecord::Search?
- Use define_method-calls instead of include in
ThinkingSphinx::ActiveRecord::Search?
What do you think?
Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---