Releases: adopted-ember-addons/ember-data-factory-guy
Releases · adopted-ember-addons/ember-data-factory-guy
v3.6.4
v3.6.3
- fixing matching get request parameters for mockAnyRequests
Example:
mock('/some/url').withParams({alive: true, id: 1, things: [2, 3]})
will now work with ember-data 3.5+
Parameter handling changed from 3.4 ember to 3.5+
v3.6.1
- factory guy now works with ember-data 3.5+
- this version uses ember/ember-data 3.6 but it still works fine in 3.5, 3.6, etc
v3.3.6
v3.3.5
- make for model fragments returns a fragment instead of an object #362 @patocallaghan
v3.3.2
- mock ( mock any request ) now works correctly when using withParams on a POST/PUT/PATCH requests
Example:
mock({url: '/post-something', type: 'POST'}).withParams({t: 1}).returns({a: 4});
v3.3.1
v3.3.0
- update ember/ember-data to => 3.3
v3.2.1
- BREAKING change for links syntax
- You can setup data AND links for your async relationship
- Need special care with multiple traits setting links
FactoryGuy.define('user', {
traits: {
withCompanyLink(f): {
// since you can assign many different links with different traits,
// you should Object.assign so that you add to the links hash rather
// than set it directly ( assuming you want to use this feature )
f.links = Object.assign({company: `/users/${f.id}/company`}, f.links);
},
withPropertiesLink(f) {
f.links = Object.assign({properties: `/users/${f.id}/properties`}, f.links);
}
}
});
let company = make('company')
// Setting a company model AND links for your async company relationship
let user = make('user', 'withCompanyLink', 'withPropertiesLink', {company});
// both links are setup
user.hasMany('properties').link(); // => "/users/1/properties"
user.belongsTo('company').link(); // => "/users/1/company"
// the company async relationship has a company AND link to fetch it again
user.get('company.content') // => company
// when you reload that relationship
user.belongsTo('company').reload() // would use that link "/users/1/company" to reload company
Sorry to change this syntax, but the syntax and behaviour now exactly matches how Ember Data handles links,
and this give you way more power than previous versions of FactoryGuy allowed you to have.
v3.2.0
- bump Ember Data and friends to 3.2
- clean up helper utilities to no longer use
__container__
and just use owner