Skip to content

Releases: adopted-ember-addons/ember-data-factory-guy

v3.6.3

06 Feb 13:22
Compare
Choose a tag to compare
  • 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

26 Jan 18:39
Compare
Choose a tag to compare
  • 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

28 Aug 20:37
Compare
Choose a tag to compare
  • update make for fragments with run loop #363

v3.3.5

28 Aug 15:57
Compare
Choose a tag to compare

v3.3.2

09 Aug 22:53
Compare
Choose a tag to compare
  • 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

31 Jul 19:12
Compare
Choose a tag to compare

v3.3.0

20 Jul 22:32
Compare
Choose a tag to compare
  • update ember/ember-data to => 3.3

v3.2.1

14 Jul 22:19
Compare
Choose a tag to compare
  • 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

07 Jul 11:55
Compare
Choose a tag to compare
  • bump Ember Data and friends to 3.2
  • clean up helper utilities to no longer use __container__ and just use owner

v3.1.7

06 Jul 22:33
Compare
Choose a tag to compare
  • made parseUrl more robust ( was affecting mockLinks update from v.3.1.6 )