Releases: adopted-ember-addons/ember-data-factory-guy
Releases · adopted-ember-addons/ember-data-factory-guy
v2.5.3
- Fixed bug when detecting attr type in model fragment check #193 @patocallaghan
v2.5.2
v2.5.1
v2.5.0
- FactoryGuy now officially supports EmberDataModelFragments #184, #185, #188
- thanks to @patocallaghan for leading the charge in adding tests for this release
- also to @mattmcginnis for getting things started
- Moved ember, ember-data to 2.5
- Bumped up version of mockjax that is installed to => 2.1.1
v2.4.5
Merged pull requests:
- Wrap arrays that use prototype extensions in Ember.A() #192 (@gilest)
- Refactor the equivalence function so that it works with arrays as well #191 (@bryanaka)
- Add Change log #190 ( @Robdel12 )
- Fix deprecation warning Ember.merge > Ember.assign for ember@2.5.0 #189 (@krasnoukhov)
- Handle active model formatted request data properly #187 (@ccleung)
v2.4.4
v2.4.3
v2.4.2
- Can now add another json payload to a current one
- Useful for sideloading arbitrary records to the current payload
- uses the
add
method on the json payload
let batMan = build('bat_man');
let user = build('user').add(batMan);
user = {
user: {
id: 1,
name: 'User1',
style: "normal"
},
'super-heros': [
{
id: 1,
name: "BatMan",
type: "SuperHero"
}
]
};
- Fixed bug in FactoryGuy.cacheOnlyMode
- Updated to newer jquery.mockjax 2.1.1 #181
v2.4.1
- Removed usage of Set and Array.from, since phantomjs 1.9x was not loving it.
v2.4.0
Major update to json payload creation
- You can now compose payload relationships to an unlimited degree with build/buildList methods
- This is kind of a big deal, because you can now compose relationships with build/buildList
like you do with make/makeList and not ever have to think about what your doing. Just do it. - Example:
let company1 = build('company', {name: 'A Corp'});
let company2 = build('company', {name: 'B Corp'});
let owners = buildList('user', { company:company1 }, { company:company2 });
let buildJson = build('property', { owners });
let buildJson = { // => RESTAdapter format
property: {
id: 1,
name: 'Silly property',
owners: [1,2]
},
users: [
{
id: 1,
name: "User1",
company: {id: 1, type: "company"},
style: "normal"
},
{
id: 2,
name: "User2",
company: {id: 2, type: "company"},
style: "normal"
}
],
companies: [
{
id: 1,
type: 'Company',
name: "A Corp"
},
{
id: 2,
type: 'Company',
name: "B Corp"
}
]
};
-
This sets the stage for being able to arbitrarily add other includes to a payload built with build/buildList methods.
- In other words .. in future could do this:
build('user').includes('cows')
-
Added new json payload proxy classes which wield ridiculous power.
-
Can now reference the id attribute in factory definition inline functions
-
Complete rewrite of json payload builders / converter classes
- If you looked at the code before it was like reading war and peace. Now it is more like green eggs and ham.
-
You might have to upgrade to phantomjs2 for automated builds if you have not already.
- It's worth it because it is so much faster than 1.9x
- see #179 for details on install on mac osx and for travis builds