Hi Kai

Not sure why this is happening, but as a quick fix, try changing it to the 
following:

  render :json => @entities.to_a

Cheers

-- 
Pat

On 29/09/2010, at 12:40 AM, turkan wrote:

> Hello.
> 
> I try to serialize an instance of my ActiveRecord model to JSON (using
> "render :json => @entities" or "@entities.to_json"), but I always get
> an CircularReferenceError
> ("ActiveSupport::JSON::Encoding::CircularReferenceError (object
> references itself)"). This only happens when the ActiveRecord
> instances are queried by using ThinkingSphinx. The to_xml
> serialization works fine. Is that a known problem? I am using the
> latest Rails 3 and ThinkingSphinx.
> 
> Best regards,
> Kai
> 
> -- 
> 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.
> 

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