This project is archived and is in readonly mode.
to_json problems with Array of 'models'
-
Coderifous
Check your model if you overrode the to_json method from ActiveRecord, it needs to accept optional ... options.
It should match to_json(options = {})
I had the problem and that was the issue.
-
Ken Collins
Me too, this ticket should be closed.
-
Nate
You could also be requiring something from the json gem somewhere else which is overriding ActiveSupport's overriding of the json gem's to_json. Code explains it better:
http://github.com/rails/rails/blob/a147becfb86b689ab25e92edcfbb4bcc...
Then maybe in config/initializers/foo.rb or in a lib or something you're doing:
require 'json/objects'
I just had this issue and it was a pain to track down. Hope that helps.