Hi Koen,

Thanks for bringing this to my attention.

I’ve pushed a patch to the develop branch which automatically converts that 
callback argument to a symbol, and until that is deployed into a release, I've 
updated the docs to add the `.to_sym` in for the example of namespace callbacks.

Cheers,

— 
Pat

> On 2 Sep 2017, at 10:39 am, Koen Eijsvogels <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> Hi,
> 
> Yesterday I stumbled on a issue with a namespaced model which I wanted to 
> have real time indexed. 
> 
> The index files has a line like: ThinkingSphinx::Index.define 'vehicle/car', 
> :with => :real_time do
> 
> In the model class Vehicle::Car < ApplicationRecord I did put the callback: 
> after_save ThinkingSphinx::RealTime.callback_for('vehicle/car') 
> 
> However when saving records, the Sphinx Index wasn't updated. After searching 
> I found that internally Thinking Sphinx converts the index definition from a 
> string to a symbol, but the string in the callback is not converted.
> 
> Maybe it is a solution to cast the input in method callback_for in file 
> real_time.rb always to symbol?
> 
> Now I solved the issue by casting the string into a symbol in the after_save 
> definition itself:
> 
> after_save ThinkingSphinx::RealTime.callback_for('vehicle/car'.to_sym) 
> 
> If this is the preferred solution, maybe it can be mentioned on the page 
> where the real time indices are explained or on the page where namespaced 
> models are explained?
> 
> 
> 
> Best regards,
> 
> Koen
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/thinking-sphinx 
> <https://groups.google.com/group/thinking-sphinx>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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