Hi Pat,

I am using rails version 2.3.4.

Starting a debugger just before: thinking-sphinx/lib/thinking_sphinx/
active_record.rb:83
I can see the list of indexed models being gathered as script/server
boots up.

Then if I place a breakpoint just before: vendor/plugins/thinking-
sphinx/lib/thinking_sphinx.rb:63
Upon hitting the first request, Thread.current
[:thinking_sphinx_indexed_models] returns nil.

I am using the following version of ruby in development:
- ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]

And in production:
- ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]

Hope this helps...

Kind regards, Oliver Beddows.

On 28 Nov, 02:05, Pat Allan <[email protected]> wrote:
> Hi Oliver
>
> I'm kinda surprised by this - I thought that array was being populated  
> at the beginning of each web request in the dev environment, but just  
> so I can track it down... what version of Rails are you using?
>
> --
> Pat
>
> On 28/11/2009, at 4:21 AM, karmacoma wrote:
>
>
>
> > Hi,
> > Using the latest version of thinking-sphinx (1.3.6). I am getting the
> > following error: "undefined method `name' for nil:NilClass" when
> > destroying a record.
>
> > The stack trace leads me to the following file: thinking-sphinx/lib/
> > thinking_sphinx/active_record.rb:229
>
> > def eldest_indexed_ancestor
> >  ancestors.reverse.detect { |ancestor|
> >    ThinkingSphinx.indexed_models.include?(ancestor.name)
> >  }.name
> > end
>
> > When the destroy method is called, "ThinkingSphinx.indexed_models"
> > returns an empty array.
>
> > However, according to my application it should be returning:
> > ["Administrator", "Article", "Customer", "Order", "Product",
> > "Representative"].
>
> > * Within production it raises the exception every time (obviously, as
> > the classes are cached).
> > * Within development it raises this exception on the first invocation,
> > but works on the second attempt, and subsequent attempts.
>
> > This seems to be an issue related to lazy loading?
>
> > In my application I often have to delete records. So I am hoping
> > someone can help me fix this problem.
>
> > Kind regards, Oliver Beddows.
>
> > --
>
> > 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 
> > athttp://groups.google.com/group/thinking-sphinx?hl=en
> > .

--

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.


Reply via email to