import DS from 'ember-data'; import { validator, buildValidations } from 'ember-cp-validations'; const Validations = buildValidations({ 'country' : { validators: [ validator('presence', { presence: true, dependentKeys: ['model.country.id'] }) ], }, 'provinceCodeDms' : validator('presence', true), 'provinceCodeHoyu' : validator('presence', true), 'province' : validator('presence', true), }); export default DS.Model.extend(Validations, { country: DS.belongsTo('country', {inverse: null}), provinceCodeDms: DS.attr('string'), provinceCodeHoyu: DS.attr('string'), province: DS.attr('string'), countriesId:DS.attr('string'), });