Created
March 25, 2014 20:08
-
-
Save rmosolgo/9770244 to your computer and use it in GitHub Desktop.
override Model::toJSON to support accepts_nested_attributes_for
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class App.Model extends Batman.Model | |
| toJSON: -> | |
| builtJSON = super | |
| builtJSON.nested_items_attributes = builtJSON.nested_items | |
| delete builtJSON.nested_items | |
| builtJSON |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment