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

Snapshots with no record should maybe only show the attributes they know about #5419

Closed
runspired opened this issue Apr 4, 2018 · 0 comments

Comments

@runspired
Copy link
Contributor

Basically, if a snapshot's internal-model does not have a record, then we know it is not the subject of a call to save and has not been used in the UI. This means that we're likely generating it for a findRecord request. We can optimize this situation by iterating attributes when generating the snapshot a bit differently:

// TODO is there a way we can assign known attributes without
// using `eachAttribute`? This forces us to lookup the model-class
// but for findRecord / findAll these are empty and doing so at
// this point in time is unnecessary.
internalModel.eachAttribute((keyName) => this._attributes[keyName] = internalModel.getAttributeValue(keyName));

cc @stefanpenner @hjdivad

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

1 participant