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

! Keep attribute if it's already a hash #33

Merged
merged 1 commit into from
Oct 27, 2014
Merged

! Keep attribute if it's already a hash #33

merged 1 commit into from
Oct 27, 2014

Conversation

Averethel
Copy link
Contributor

Fixes a bug with updating entries with one to many associations.

  • Scenario:
    • Collection that has many Entries and description
    • I want to update the description via entry.update
  • What happens:
    • entry.fields[:entries] array already includes the entries in the required hash format but is then parsed
    • the parser checks the type of the attribute
    • type is neither Asset nor Entry
    • nil replaces entry that does not require parsing
  • Suggested solution:
    • keep the entry in the array if it's already a hash

@pxlpnk pxlpnk self-assigned this Oct 23, 2014
@pxlpnk
Copy link
Contributor

pxlpnk commented Oct 23, 2014

Thank your for your pull request.
Could you please supply a test that handles this case and update the commit message that it does not start with a !

@pxlpnk
Copy link
Contributor

pxlpnk commented Oct 27, 2014

@Averethel any chance to get this done?

@Averethel
Copy link
Contributor Author

@pxlpnk Sorry I was away for the weekend. Done now.

@pxlpnk
Copy link
Contributor

pxlpnk commented Oct 27, 2014

Awesome thanks! Merging ASAP!

pxlpnk added a commit that referenced this pull request Oct 27, 2014
Keep attribute if it's already a hash
@pxlpnk pxlpnk merged commit 3496be6 into contentful:master Oct 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants