-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send options to to_json #34
Comments
@prcongithub - So I can understand your JrJackson usage better, upon what objects is to_json being called? I take it that you have read: |
May be I am missing something here, So JrJackson doesn't support ActiveRecord objects. But if you still call dump method with AR objects, JrJackson will fallback to .to_json right? If so, then can't we pass options to the to_json method? |
ActiveRecord object do not have a to_json method. What other objects is to_json being called on? |
@prcongithub OK - I misled you. It does, but it only (eventually) delegates to the Json gem, and then it does not pass the options that far. Why use JrJackson at all if AR ends up calling the Json gem? JrJackson supports the to_json method as a last resort if the custom object author implemented to_json. I really regret including the fallback to to_json, for the above reason. |
Closing - no more feedback |
Why can't we send the options to to_json method?
https://github.com/guyboertje/jrjackson/blob/master/lib/jrjackson/jrjackson.rb#L44
The text was updated successfully, but these errors were encountered: