Skip to content

DRY up how attributes are deserialized#133

Merged
Dhaulagiri merged 1 commit into
masterfrom
br-serial
Feb 10, 2018
Merged

DRY up how attributes are deserialized#133
Dhaulagiri merged 1 commit into
masterfrom
br-serial

Conversation

@Dhaulagiri

@Dhaulagiri Dhaulagiri commented Feb 9, 2018

Copy link
Copy Markdown
Collaborator

Closes #55

This should make it simpler to add additional properties without needing to manually serialize each and every one

},
type: 'User',
// needs to be the actual related model name for Ember Data reasons? 🤔
type: 'github-user',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

there is something funky happening here with how the mirage record is getting serialized which required this to get the tests to behave. Trying things in a real app I'm not seeing a similar issue.

import { decamelize } from '@ember/string';

export default DS.RESTSerializer.extend({
keyForAttribute(attr) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Awesome

@Dhaulagiri
Dhaulagiri merged commit cec7646 into master Feb 10, 2018
@Dhaulagiri
Dhaulagiri deleted the br-serial branch February 10, 2018 01:31
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.

2 participants