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

Fix: Serialize resource type for unpersisted records (blank id) #2216

Merged
merged 6 commits into from
Nov 1, 2017

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Oct 31, 2017

Current behavior when id is nil returns: {data: null}

Closes #2132
Closes #2180

Regression from v0.10.5 to v0.10.6

Incidental changes in the PR

@bf4
Copy link
Member Author

bf4 commented Oct 31, 2017

cc interested parties @InteNs @morhekil @yoda @beet @xn @Genkilabs @gambala

@xn
Copy link
Contributor

xn commented Nov 1, 2017

Thanks!

@InteNs
Copy link

InteNs commented Nov 1, 2017

looks good!

@bf4 bf4 merged commit 3c5e11b into 0-10-stable Nov 1, 2017
@bf4 bf4 deleted the serialize_resource_with_nil_id branch November 1, 2017 15:36
@bf4
Copy link
Member Author

bf4 commented Nov 1, 2017

Anything else before I release a 0.10.7? I think the only other regression is #2178

@Genkilabs
Copy link

Terrific! Thank you for this, and for including the CC in the related PR.
^_^

@beet
Copy link

beet commented Nov 3, 2017

Awesome, thanks @bf4 !

@@ -38,8 +39,11 @@ def initialize(serializer, options)
end

def as_json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arguably, if serializer.object is nil, the return value should be nil, not { type: type}, and consider it a 'nil' identifier

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

Successfully merging this pull request may close these issues.

5 participants