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

Set model.id if attributes contain a parsed version of idAttribute #1760

Merged
merged 2 commits into from Feb 11, 2018

Conversation

ricardograca
Copy link
Member

Introduction

This ensures that Model#id is set correctly even if the model has a custom parse method that mutates attribute keys.

Motivation

This is a followup to the previous PR that needed some changes but its author didn't respond.

Proposed solution

This is almost identical to the previous PR, except that it doesn't store the parsed id attribute when extending the model but instead parses it when it's actually needed. This ensures that the parsed idAttribute is always correct.

This PR also doesn't include the exception when not all relations can be retrieved since it wasn't clear what the purpose of that code was.

Closes #1082.

- This ensures that Model#id is set correctly even if the model has a
custom parse method that mutates attribute keys.
@ricardograca ricardograca added this to To Do in Version 0.13.0 via automation Feb 11, 2018
@ricardograca ricardograca moved this from To Do to In Progress in Version 0.13.0 Feb 11, 2018
@ricardograca ricardograca merged commit b6d1068 into master Feb 11, 2018
Version 0.13.0 automation moved this from In Progress to Done Feb 11, 2018
@ricardograca ricardograca deleted the rg-parse-idAttribute branch February 11, 2018 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant