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

dao.get({ plain: true }) doesn't work for reloaded objects #4844

Closed
garrettg123 opened this issue Nov 12, 2015 · 1 comment
Closed

dao.get({ plain: true }) doesn't work for reloaded objects #4844

garrettg123 opened this issue Nov 12, 2015 · 1 comment

Comments

@garrettg123
Copy link

Consider the following example:

var user = yield User.create({ settingsId })
yield user.reload({ include: settingsAssociation })

_.isPlainObject(user.get({ plain: true }).settings) // false

It works when the dao is retrieved using querying, just not when reloaded with include.

@mickhansen
Copy link
Contributor

reload does not update the internal options of the instance (which contains what includes to iterate while doing a get).

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

No branches or pull requests

2 participants