Skip to content
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

toJSON to include all attributes at all levels #7

Open
cjmyles opened this issue Jun 5, 2014 · 1 comment
Open

toJSON to include all attributes at all levels #7

cjmyles opened this issue Jun 5, 2014 · 1 comment

Comments

@cjmyles
Copy link
Contributor

cjmyles commented Jun 5, 2014

Hey Jonny, me again!

Is there an easy way to call model.toJSON() and return all attributes and nested collections/models and all their attributes, all the way down the chain?

The only way I could find to do it was change backbone-jjrelational.js file within the toJSON function and replace:

withRelIDs: true

with

withRelIDs: !!options.withRelIDs

Then I call model.toJSON({withRelIDs: false})

@johnnycrab
Copy link
Member

I'm so sorry, I'm currently caught up in my master's thesis, and somehow I totally forgot to respond!
Is this still relevant? If yes, I'll look into it as soon as I can!

Sorry again,
Johnny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants