DS.EmbeddedRecordsMixin#_extractEmbeddedRecords()

_extractEmbeddedRecordsprivate Defined in addon/serializers/embedded-records-mixin.js:530

DS.EmbeddedRecordsMixin#_normalizeEmbeddedRelationship()

_normalizeEmbeddedRelationshipprivate Defined in addon/serializers/embedded-records-mixin.js:600

DS.EmbeddedRecordsMixin#serializeHasMany()

serializeHasMany (snapshot, json, relationship) Defined in addon/serializers/embedded-records-mixin.js:240 Serializes hasMany relationships when it is configured as embedded objects. This example of a post model has many comments: Post = DS.Model.extend({ title: DS.attr('string'), body: DS.attr('string'), comments: DS.hasMany('comment') }); Comment = DS.Model.extend({ body: DS.attr('string'), post: DS.belongsTo('post') }); Use a custom (type) serializer for the p

DS.EmbeddedRecordsMixin#serializeBelongsTo()

serializeBelongsTo (snapshot, json, relationship) Defined in addon/serializers/embedded-records-mixin.js:141 Serialize belongsTo relationship when it is configured as an embedded object. This example of an author model belongs to a post model: Post = DS.Model.extend({ title: DS.attr('string'), body: DS.attr('string'), author: DS.belongsTo('author') }); Author = DS.Model.extend({ name: DS.attr('string'), post: DS.belongsTo('post') }); Use a custom (type) seriali

DS.EmbeddedRecordsMixin#_extractEmbeddedHasMany()

_extractEmbeddedHasManyprivate Defined in addon/serializers/embedded-records-mixin.js:548

DS.EmbeddedRecordsMixin#_extractEmbeddedBelongsTo()

_extractEmbeddedBelongsToprivate Defined in addon/serializers/embedded-records-mixin.js:577

DS.DateTransform

DS.DateTransform Class Extends: DS.Transform Defined in: addon/-private/transforms/date.js:3 Module: ember-data The DS.DateTransform class is used to serialize and deserialize date attributes on Ember Data record objects. This transform is used when date is passed as the type parameter to the DS.attr function. It uses the ISO 8601 standard. app/models/score.js import DS from 'ember-data'; export default DS.Model.extend({ value: DS.attr('number'), player: DS.belongsTo('player'), date

DS.EmbeddedRecordsMixin#normalize()

normalize (typeClass, hash, prop) Object Defined in addon/serializers/embedded-records-mixin.js:100 Normalize the record and recursively normalize/extract all the embedded records while pushing them into the store as they are encountered A payload with an attr configured for embedded records needs to be extracted: { "post": { "id": "1" "title": "Rails is omakase", "comments": [{ "id": "1", "body": "Rails is unagi" }, { "id": "2", "body": "Omakase O_

DS.EmbeddedRecordsMixin

DS.EmbeddedRecordsMixin Class Defined in: addon/serializers/embedded-records-mixin.js:8 Module: ember-data Using Embedded Records DS.EmbeddedRecordsMixin supports serializing embedded records. To set up embedded records, include the mixin when extending a serializer, then define and configure embedded (model) relationships. Below is an example of a per-type serializer (post type). app/serializers/post.js import DS from 'ember-data'; export default DS.RESTSerializer.extend(DS.EmbeddedRecor

DS.EmbeddedRecordsMixin#removeEmbeddedForeignKey()

removeEmbeddedForeignKey (snapshot, embeddedSnapshot, relationship, json) Defined in addon/serializers/embedded-records-mixin.js:453 When serializing an embedded record, modify the property (in the json payload) that refers to the parent record (foreign key for relationship). Serializing a belongsTo relationship removes the property that refers to the parent record Serializing a hasMany relationship does not remove the property that refers to the parent record. Parameters: snapshot DS.S