*Problem:*
In our application we also have a generic search function that uses many 
different indices. Each index can be sorted differently. Therefore, we want 
to examine the indices to determine if certain attributes are present and 
can be sorted. We are attempting to use a line of code like:

ThinkingSphinx::Configuration.instance.indices.detect { |i| i.model == 
klass }.attributes.any? {|a| a.name == "updated_at" }

*Issue:*
The above works great most of the time. However, if we change the file 
where this line of code exists more than 2 times (3 or more times) we 
receive the below error:

NoMethodError - undefined method `attributes' for 
#<ThinkingSphinx::Distributed::Index:0x007facb051d268>:


I assume there is some sort of Rails development class loading issue going 
on here and I have no idea why it is the 3rd time where it fails. I'm 
unsure if this same issue happens in production.


*Question:*

My question is #1 do you see a better way to solve this problem or #2 is 
this a bug that needs logged?

*Stack:*
Rails: 4.2.5.1
Ruby: 2.2.3
OS: Linux & OSX
Thinking Sphinx: 3.1.3
Sphinx: 2.2.10

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to