Skip to content

Instantly share code, notes, and snippets.

@mtodd
Created November 18, 2010 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtodd/705567 to your computer and use it in GitHub Desktop.
Save mtodd/705567 to your computer and use it in GitHub Desktop.
# #to_json isn't populating the results correctly and a CircularReference error
# is getting raised. This makes sure that populate is called first and #to_json
# is called on the result array.
ThinkingSphinx::Search.class_eval do
def as_json(*args)
populate
@array.as_json(*args)
end
def to_json(*args)
populate
@array.to_json(*args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment