CrshOverride / ember-web-api

Ember Data Addon for .NET Web API Endpoints
MIT License
20 stars 12 forks source link

An addition control has been added for hasMany serializer checks. #12

Open osmanorhan opened 8 years ago

osmanorhan commented 8 years ago

This control added because when I try to add an additional model serializer with embed options, it assumes there is a hasMany relation but function (snapshot.hasMany) returns undefined. Example:

X Model:
     name: DS.attr(),
     attr: DS.hasMany('attr'),

Y Model:
   code: DS.attr(),
   xs: DS.belongsTo('X')

Y Serializer:
import ApplicationSerializer from './application';
import DS from 'ember-data';
export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
     attrs: {
        xs: { embedded: 'always' },
    },
});

In example, I want to use embedded "xs" when I save model but it gets error due to X.attr.

codecov-io commented 8 years ago

Current coverage is 75.00% (diff: 0.00%)

No coverage report found for master at f6826c5.

Powered by Codecov. Last update f6826c5...d0af8b8