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

Projects
1 participant
@ricardograca
Member

ricardograca commented Feb 11, 2018

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.

ricardograca added some commits Feb 11, 2018

Set Model#id if attrs contain parsed idAttribute
- This ensures that Model#id is set correctly even if the model has a
custom parse method that mutates attribute keys.

@ricardograca ricardograca added the bug label Feb 11, 2018

@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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

Version 0.13.0 automation moved this from In Progress to Done Feb 11, 2018

@ricardograca ricardograca deleted the rg-parse-idAttribute branch Feb 11, 2018

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