Last active
August 29, 2015 14:02
-
-
Save tobobo/0d42ee5477cc1d94283f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Authentication = DS.Model.extend | |
| user_id: DS.attr 'number' | |
| facebook_id: DS.attr 'string' | |
| facebook_updated: DS.attr 'date' | |
| user: DS.belongsTo 'user' | |
| `export default Authentication` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User = DS.Model.extend | |
| email: DS.attr 'string' | |
| password: DS.attr 'string' | |
| reach: DS.attr 'number' | |
| picture: DS.attr 'string' | |
| name: DS.attr 'string' | |
| authentication: DS.belongsTo 'authentication' | |
| displayName: (-> | |
| @get('name') or @get('email') | |
| ).property 'email', 'name' | |
| `export default User` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "user": { | |
| "id": 3, | |
| "email": "[email protected]", | |
| "password": "$2a$10Fej09Aj0FKpEJV3/Nx8XHV6tM/J.aM6la", | |
| "picture": null, | |
| "created_at": "2014-06-11T19:39:00.496Z", | |
| "updated_at": "2014-06-11T19:39:00.588Z", | |
| "reach": 250, | |
| "name": null, | |
| "authentication": { | |
| "id": 3, | |
| "user_id": 3, | |
| "facebook_id": "12345", | |
| "facebook_access_token": "blah blah", | |
| "facebook_refresh_token": null, | |
| "facebook_updated": "2014-06-11T07:00:00.000Z", | |
| "stripe_customer_id": null, | |
| "stripe_card_token": null, | |
| "created_at": null, | |
| "updated_at": null | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UserSerializer = DS.RESTSerializer.extend DS.EmbeddedRecordsMixin, | |
| keyForAttribute: (attr) -> attr | |
| attrs: | |
| authentication: | |
| embedded: 'always' | |
| `export default UserSerializer` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment