ember-data-source 2.8.1 → 2.9.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56df9713fc5d83030267523aba1125f532f06466
4
- data.tar.gz: 4539d65f8061b22a47eec1119ca48909eb218507
3
+ metadata.gz: bae76365d91efca3f6f55697a668ae23c7d055df
4
+ data.tar.gz: 03bc4cfa4b284dbcd68ee240e190246789720da3
5
5
  SHA512:
6
- metadata.gz: 5573776abfd1d834b189ae0ec654d167f4605af194b57ff0a3b1982b9c08d81137b87b58b56b988f0f79659190b8203b038ac6d234d5d81eecb76debe0e7a563
7
- data.tar.gz: 97270c3ea6519ebf611cb536da6f754a30fd5fd345f1cde99324185f194751744f3f0d83b3cefb358947ee96ce832324c00bf455feed19a2b4038bcca86eae2b
6
+ metadata.gz: 36ff0f4ef114b0db57813f699d39b4b6f13c216d20329aac5a51bdae789b5dc1191746d605b620187666678432e027cab38298b1e551c264197ac7c05010fc44
7
+ data.tar.gz: 1e4065235d598a7c5774c09b96ec6cdbceeab3f9ec69166f0b62044b919e00c6fc9b9675c19b3871ddfa7790ce71eea0abc1756a4d9a30ba184939ad6bb17233
@@ -6,7 +6,7 @@
6
6
  * @copyright Copyright 2011-2016 Tilde Inc. and contributors.
7
7
  * Portions Copyright 2011 LivingSocial Inc.
8
8
  * @license Licensed under MIT license (see license.js)
9
- * @version 2.8.1
9
+ * @version 2.9.0-beta.1
10
10
  */
11
11
 
12
12
  var loader, define, requireModule, require, requirejs;
@@ -956,65 +956,6 @@ define('ember-data/-private/system/coerce-id', ['exports'], function (exports) {
956
956
  return id === null || id === undefined || id === '' ? null : id + '';
957
957
  }
958
958
  });
959
- define('ember-data/-private/system/container-proxy', ['exports', 'ember-data/-private/debug'], function (exports, _emberDataPrivateDebug) {
960
- exports.default = ContainerProxy;
961
-
962
- /*
963
- This is used internally to enable deprecation of container paths and provide
964
- a decent message to the user indicating how to fix the issue.
965
-
966
- @class ContainerProxy
967
- @namespace DS
968
- @private
969
- */
970
-
971
- function ContainerProxy(container) {
972
- this.container = container;
973
- }
974
-
975
- ContainerProxy.prototype.aliasedFactory = function (path, preLookup) {
976
- var _this = this;
977
-
978
- return {
979
- create: function () {
980
- if (preLookup) {
981
- preLookup();
982
- }
983
-
984
- return _this.container.lookup(path);
985
- }
986
- };
987
- };
988
-
989
- ContainerProxy.prototype.registerAlias = function (source, dest, preLookup) {
990
- var factory = this.aliasedFactory(dest, preLookup);
991
-
992
- return this.container.register(source, factory);
993
- };
994
-
995
- ContainerProxy.prototype.registerDeprecation = function (deprecated, valid) {
996
- var preLookupCallback = function () {
997
- (0, _emberDataPrivateDebug.deprecate)('You tried to look up \'' + deprecated + '\', but this has been deprecated in favor of \'' + valid + '\'.', false, {
998
- id: 'ds.store.deprecated-lookup',
999
- until: '2.0.0'
1000
- });
1001
- };
1002
-
1003
- return this.registerAlias(deprecated, valid, preLookupCallback);
1004
- };
1005
-
1006
- ContainerProxy.prototype.registerDeprecations = function (proxyPairs) {
1007
- var i, proxyPair, deprecated, valid;
1008
-
1009
- for (i = proxyPairs.length; i > 0; i--) {
1010
- proxyPair = proxyPairs[i - 1];
1011
- deprecated = proxyPair['deprecated'];
1012
- valid = proxyPair['valid'];
1013
-
1014
- this.registerDeprecation(deprecated, valid);
1015
- }
1016
- };
1017
- });
1018
959
  define("ember-data/-private/system/debug", ["exports", "ember-data/-private/system/debug/debug-adapter"], function (exports, _emberDataPrivateSystemDebugDebugAdapter) {
1019
960
  exports.default = _emberDataPrivateSystemDebugDebugAdapter.default;
1020
961
  });
@@ -2973,11 +2914,21 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
2973
2914
  },
2974
2915
 
2975
2916
  referenceFor: function (type, name) {
2917
+ var _this3 = this;
2918
+
2976
2919
  var reference = this.references[name];
2977
2920
 
2978
2921
  if (!reference) {
2979
2922
  var relationship = this._relationships.get(name);
2980
2923
 
2924
+ (0, _emberDataPrivateDebug.runInDebug)(function () {
2925
+ var modelName = _this3.modelName;
2926
+ (0, _emberDataPrivateDebug.assert)("There is no " + type + " relationship named '" + name + "' on a model of type '" + modelName + "'", relationship);
2927
+
2928
+ var actualRelationshipKind = relationship.relationshipMeta.kind;
2929
+ (0, _emberDataPrivateDebug.assert)("You tried to get the '" + name + "' relationship on a '" + modelName + "' via record." + type + "('" + name + "'), but the relationship is of type '" + actualRelationshipKind + "'. Use record." + actualRelationshipKind + "('" + name + "') instead.", actualRelationshipKind === type);
2930
+ });
2931
+
2981
2932
  if (type === "belongsTo") {
2982
2933
  reference = new _emberDataPrivateSystemReferences.BelongsToReference(this.store, this, relationship);
2983
2934
  } else if (type === "hasMany") {
@@ -2991,7 +2942,7 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
2991
2942
  }
2992
2943
  };
2993
2944
 
2994
- if (false) {
2945
+ if ((0, _emberDataPrivateFeatures.default)('ds-reset-attribute')) {
2995
2946
  /*
2996
2947
  Returns the latest truth for an attribute - the canonical value, or the
2997
2948
  in-flight value.
@@ -3411,6 +3362,13 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3411
3362
  */
3412
3363
  rolledBack: _ember.default.K,
3413
3364
 
3365
+ /**
3366
+ @property data
3367
+ @private
3368
+ @type {Object}
3369
+ */
3370
+ data: _ember.default.computed.readOnly('_internalModel._data'),
3371
+
3414
3372
  //TODO Do we want to deprecate these?
3415
3373
  /**
3416
3374
  @method send
@@ -3827,17 +3785,6 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3827
3785
  })
3828
3786
  });
3829
3787
 
3830
- /**
3831
- @property data
3832
- @private
3833
- @type {Object}
3834
- */
3835
- Object.defineProperty(Model.prototype, 'data', {
3836
- get: function () {
3837
- return this._internalModel._data;
3838
- }
3839
- });
3840
-
3841
3788
  Model.reopenClass({
3842
3789
  /**
3843
3790
  Alias DS.Model's `create` method to `_create`. This allows us to create DS.Model
@@ -3884,6 +3831,7 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3884
3831
  @property modelName
3885
3832
  @type String
3886
3833
  @readonly
3834
+ @static
3887
3835
  */
3888
3836
  modelName: null
3889
3837
  });
@@ -3905,7 +3853,7 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3905
3853
  });
3906
3854
  }
3907
3855
 
3908
- if (false) {
3856
+ if ((0, _emberDataPrivateFeatures.default)('ds-reset-attribute')) {
3909
3857
  Model.reopen({
3910
3858
  /**
3911
3859
  Discards any unsaved changes to the given attribute.
@@ -4725,13 +4673,17 @@ define('ember-data/-private/system/normalize-link', ['exports'], function (expor
4725
4673
  define('ember-data/-private/system/normalize-model-name', ['exports', 'ember'], function (exports, _ember) {
4726
4674
  exports.default = normalizeModelName;
4727
4675
 
4676
+ // All modelNames are dasherized internally. Changing this function may
4677
+ // require changes to other normalization hooks (such as typeForRoot).
4678
+
4728
4679
  /**
4729
- All modelNames are dasherized internally. Changing this function may
4730
- require changes to other normalization hooks (such as typeForRoot).
4680
+ This method normalizes a modelName into the format Ember Data uses
4681
+ internally.
4682
+
4731
4683
  @method normalizeModelName
4732
4684
  @public
4733
4685
  @param {String} modelName
4734
- @return {String} if the adapter can generate one, an ID
4686
+ @return {String} normalizedModelName
4735
4687
  @for DS
4736
4688
  */
4737
4689
 
@@ -5637,7 +5589,7 @@ define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-da
5637
5589
  var record;
5638
5590
 
5639
5591
  if (data instanceof _emberDataModel.default) {
5640
- if (false) {
5592
+ if ((0, _emberDataPrivateFeatures.default)('ds-overhaul-references')) {
5641
5593
  (0, _emberDataPrivateDebug.deprecate)("BelongsToReference#push(DS.Model) is deprecated. Update relationship via `model.set('relationshipName', value)` instead.", false, {
5642
5594
  id: 'ds.references.belongs-to.push-record',
5643
5595
  until: '3.0'
@@ -5738,7 +5690,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
5738
5690
  return _ember.default.RSVP.resolve(objectOrPromise).then(function (payload) {
5739
5691
  var array = payload;
5740
5692
 
5741
- if (false) {
5693
+ if ((0, _emberDataPrivateFeatures.default)("ds-overhaul-references")) {
5742
5694
  (0, _emberDataPrivateDebug.deprecate)("HasManyReference#push(array) is deprecated. Push a JSON-API document instead.", !Array.isArray(payload), {
5743
5695
  id: 'ds.references.has-many.push-array',
5744
5696
  until: '3.0'
@@ -5750,7 +5702,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
5750
5702
  array = payload.data;
5751
5703
  useLegacyArrayPush = array.length && array[0].data;
5752
5704
 
5753
- if (false) {
5705
+ if ((0, _emberDataPrivateFeatures.default)('ds-overhaul-references')) {
5754
5706
  (0, _emberDataPrivateDebug.deprecate)("HasManyReference#push() expects a valid JSON-API document.", !useLegacyArrayPush, {
5755
5707
  id: 'ds.references.has-many.push-invalid-json-api',
5756
5708
  until: '3.0'
@@ -5758,7 +5710,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
5758
5710
  }
5759
5711
  }
5760
5712
 
5761
- if (!false) {
5713
+ if (!(0, _emberDataPrivateFeatures.default)('ds-overhaul-references')) {
5762
5714
  useLegacyArrayPush = true;
5763
5715
  }
5764
5716
 
@@ -9424,7 +9376,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9424
9376
  this._backburner.schedule('normalizeRelationships', this, '_setupRelationships', internalModel, data);
9425
9377
  this.updateId(internalModel, data);
9426
9378
  }
9427
-
9379
+ (0, _emberDataPrivateDebug.assert)('Your ' + internalModel.type.modelName + ' record was saved but it does not have an id. Please make the server provides an id in the createRecord response or you are setting the on the client side before saving the record.', internalModel.id !== null);
9428
9380
  //We first make sure the primary data has been updated
9429
9381
  //TODO try to move notification to the user to the end of the runloop
9430
9382
  internalModel.adapterDidCommit(data);
@@ -9563,9 +9515,11 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9563
9515
  },
9564
9516
 
9565
9517
  /**
9566
- Returns a model class for a particular key. Used by
9567
- methods that take a type key (like `find`, `createRecord`,
9568
- etc.)
9518
+ Returns the model class for the particular `modelName`.
9519
+ The class of a model might be useful if you want to get a list of all the
9520
+ relationship names of the model, see
9521
+ [`relationshipNames`](http://emberjs.com/api/data/classes/DS.Model.html#property_relationshipNames)
9522
+ for example.
9569
9523
  @method modelFor
9570
9524
  @param {String} modelName
9571
9525
  @return {DS.Model}
@@ -9864,7 +9818,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9864
9818
  (0, _emberDataPrivateDebug.assert)('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + _ember.default.inspect(modelName), typeof modelName === 'string');
9865
9819
  serializer = this.serializerFor(modelName);
9866
9820
  }
9867
- if (false) {
9821
+ if ((0, _emberDataPrivateFeatures.default)('ds-pushpayload-return')) {
9868
9822
  return this._adapterRun(function () {
9869
9823
  return serializer.pushPayload(_this3, payload);
9870
9824
  });
@@ -10235,7 +10189,7 @@ define('ember-data/-private/system/store/container-instance-cache', ['exports',
10235
10189
 
10236
10190
  var assign = _ember.default.assign || _ember.default.merge;
10237
10191
 
10238
- /**
10192
+ /*
10239
10193
  * The `ContainerInstanceCache` serves as a lazy cache for looking up
10240
10194
  * instances of serializers and adapters. It has some additional logic for
10241
10195
  * finding the 'fallback' adapter or serializer.
@@ -10657,6 +10611,20 @@ define('ember-data/-private/transforms/boolean', ['exports', 'ember', 'ember-dat
10657
10611
  });
10658
10612
  ```
10659
10613
 
10614
+ By default the boolean transform only allows for values of `true` or
10615
+ `false`. You can opt into allowing `null` values for
10616
+ boolean attributes via `DS.attr('boolean', { allowNull: true })`
10617
+
10618
+ ```app/models/user.js
10619
+ import DS from 'ember-data';
10620
+
10621
+ export default DS.Model.extend({
10622
+ email: DS.attr('string'),
10623
+ username: DS.attr('string'),
10624
+ wantsWeeklyEmail: DS.attr('boolean', { allowNull: true })
10625
+ });
10626
+ ```
10627
+
10660
10628
  @class BooleanTransform
10661
10629
  @extends DS.Transform
10662
10630
  @namespace DS
@@ -10725,7 +10693,8 @@ define("ember-data/-private/transforms/date", ["exports", "ember-data/-private/e
10725
10693
  The `DS.DateTransform` class is used to serialize and deserialize
10726
10694
  date attributes on Ember Data record objects. This transform is used
10727
10695
  when `date` is passed as the type parameter to the
10728
- [DS.attr](../../data#method_attr) function.
10696
+ [DS.attr](../../data#method_attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601)
10697
+ standard.
10729
10698
 
10730
10699
  ```app/models/score.js
10731
10700
  import DS from 'ember-data';
@@ -11341,7 +11310,7 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11341
11310
  write:
11342
11311
  ```javascript
11343
11312
  shouldReloadRecord: function(store, ticketSnapshot) {
11344
- var timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt')).minutes();
11313
+ var timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');
11345
11314
  if (timeDiff > 20) {
11346
11315
  return true;
11347
11316
  } else {
@@ -11355,6 +11324,10 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11355
11324
  resolve until you fetched the latest version.
11356
11325
  By default this hook returns `false`, as most UIs should not block user
11357
11326
  interactions while waiting on data update.
11327
+ Note that, with default settings, `shouldBackgroundReloadRecord` will always
11328
+ re-fetch the records in the background even if `shouldReloadRecord` returns
11329
+ `false`. You can override `shouldBackgroundReloadRecord` if this does not
11330
+ suit your use case.
11358
11331
  @since 1.13.0
11359
11332
  @method shouldReloadRecord
11360
11333
  @param {DS.Store} store
@@ -11380,7 +11353,7 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11380
11353
  shouldReloadAll: function(store, snapshotArray) {
11381
11354
  var snapshots = snapshotArray.snapshots();
11382
11355
  return snapshots.any(function(ticketSnapshot) {
11383
- var timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt')).minutes();
11356
+ var timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');
11384
11357
  if (timeDiff > 20) {
11385
11358
  return true;
11386
11359
  } else {
@@ -11396,6 +11369,10 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11396
11369
  By default this methods returns `true` if the passed `snapshotRecordArray`
11397
11370
  is empty (meaning that there are no records locally available yet),
11398
11371
  otherwise it returns `false`.
11372
+ Note that, with default settings, `shouldBackgroundReloadAll` will always
11373
+ re-fetch all the records in the background even if `shouldReloadAll` returns
11374
+ `false`. You can override `shouldBackgroundReloadAll` if this does not suit
11375
+ your use case.
11399
11376
  @since 1.13.0
11400
11377
  @method shouldReloadAll
11401
11378
  @param {DS.Store} store
@@ -11505,7 +11482,7 @@ define('ember-data/adapters/errors', ['exports', 'ember', 'ember-data/-private/d
11505
11482
  }
11506
11483
 
11507
11484
  var extendedErrorsEnabled = false;
11508
- if (false) {
11485
+ if ((0, _emberDataPrivateFeatures.default)('ds-extended-errors')) {
11509
11486
  extendedErrorsEnabled = true;
11510
11487
  }
11511
11488
 
@@ -11796,7 +11773,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11796
11773
  @return {Promise} promise
11797
11774
  */
11798
11775
  findMany: function (store, type, ids, snapshots) {
11799
- if (false && !this._hasCustomizedAjax()) {
11776
+ if (true && !this._hasCustomizedAjax()) {
11800
11777
  return this._super.apply(this, arguments);
11801
11778
  } else {
11802
11779
  var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
@@ -11823,7 +11800,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11823
11800
  @return {Promise} promise
11824
11801
  */
11825
11802
  updateRecord: function (store, type, snapshot) {
11826
- if (false && !this._hasCustomizedAjax()) {
11803
+ if (true && !this._hasCustomizedAjax()) {
11827
11804
  return this._super.apply(this, arguments);
11828
11805
  } else {
11829
11806
  var data = {};
@@ -11859,7 +11836,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11859
11836
  }
11860
11837
  });
11861
11838
 
11862
- if (false) {
11839
+ if (true) {
11863
11840
 
11864
11841
  JSONAPIAdapter.reopen({
11865
11842
 
@@ -12287,7 +12264,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12287
12264
  @return {Promise} promise
12288
12265
  */
12289
12266
  findRecord: function (store, type, id, snapshot) {
12290
- if (false && !this._hasCustomizedAjax()) {
12267
+ if (true && !this._hasCustomizedAjax()) {
12291
12268
  var request = this._requestFor({
12292
12269
  store: store, type: type, id: id, snapshot: snapshot,
12293
12270
  requestType: 'findRecord'
@@ -12317,7 +12294,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12317
12294
  findAll: function (store, type, sinceToken, snapshotRecordArray) {
12318
12295
  var query = this.buildQuery(snapshotRecordArray);
12319
12296
 
12320
- if (false && !this._hasCustomizedAjax()) {
12297
+ if (true && !this._hasCustomizedAjax()) {
12321
12298
  var request = this._requestFor({
12322
12299
  store: store, type: type, sinceToken: sinceToken, query: query,
12323
12300
  snapshots: snapshotRecordArray,
@@ -12351,7 +12328,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12351
12328
  @return {Promise} promise
12352
12329
  */
12353
12330
  query: function (store, type, query) {
12354
- if (false && !this._hasCustomizedAjax()) {
12331
+ if (true && !this._hasCustomizedAjax()) {
12355
12332
  var request = this._requestFor({
12356
12333
  store: store, type: type, query: query,
12357
12334
  requestType: 'query'
@@ -12385,7 +12362,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12385
12362
  @return {Promise} promise
12386
12363
  */
12387
12364
  queryRecord: function (store, type, query) {
12388
- if (false && !this._hasCustomizedAjax()) {
12365
+ if (true && !this._hasCustomizedAjax()) {
12389
12366
  var request = this._requestFor({
12390
12367
  store: store, type: type, query: query,
12391
12368
  requestType: 'queryRecord'
@@ -12430,7 +12407,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12430
12407
  @return {Promise} promise
12431
12408
  */
12432
12409
  findMany: function (store, type, ids, snapshots) {
12433
- if (false && !this._hasCustomizedAjax()) {
12410
+ if (true && !this._hasCustomizedAjax()) {
12434
12411
  var request = this._requestFor({
12435
12412
  store: store, type: type, ids: ids, snapshots: snapshots,
12436
12413
  requestType: 'findMany'
@@ -12470,7 +12447,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12470
12447
  @return {Promise} promise
12471
12448
  */
12472
12449
  findHasMany: function (store, snapshot, url, relationship) {
12473
- if (false && !this._hasCustomizedAjax()) {
12450
+ if (true && !this._hasCustomizedAjax()) {
12474
12451
  var request = this._requestFor({
12475
12452
  store: store, snapshot: snapshot, url: url, relationship: relationship,
12476
12453
  requestType: 'findHasMany'
@@ -12514,7 +12491,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12514
12491
  @return {Promise} promise
12515
12492
  */
12516
12493
  findBelongsTo: function (store, snapshot, url, relationship) {
12517
- if (false && !this._hasCustomizedAjax()) {
12494
+ if (true && !this._hasCustomizedAjax()) {
12518
12495
  var request = this._requestFor({
12519
12496
  store: store, snapshot: snapshot, url: url, relationship: relationship,
12520
12497
  requestType: 'findBelongsTo'
@@ -12544,7 +12521,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12544
12521
  @return {Promise} promise
12545
12522
  */
12546
12523
  createRecord: function (store, type, snapshot) {
12547
- if (false && !this._hasCustomizedAjax()) {
12524
+ if (true && !this._hasCustomizedAjax()) {
12548
12525
  var request = this._requestFor({
12549
12526
  store: store, type: type, snapshot: snapshot,
12550
12527
  requestType: 'createRecord'
@@ -12576,7 +12553,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12576
12553
  @return {Promise} promise
12577
12554
  */
12578
12555
  updateRecord: function (store, type, snapshot) {
12579
- if (false && !this._hasCustomizedAjax()) {
12556
+ if (true && !this._hasCustomizedAjax()) {
12580
12557
  var request = this._requestFor({
12581
12558
  store: store, type: type, snapshot: snapshot,
12582
12559
  requestType: 'updateRecord'
@@ -12606,7 +12583,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12606
12583
  @return {Promise} promise
12607
12584
  */
12608
12585
  deleteRecord: function (store, type, snapshot) {
12609
- if (false && !this._hasCustomizedAjax()) {
12586
+ if (true && !this._hasCustomizedAjax()) {
12610
12587
  var request = this._requestFor({
12611
12588
  store: store, type: type, snapshot: snapshot,
12612
12589
  requestType: 'deleteRecord'
@@ -12742,7 +12719,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12742
12719
  var errors = this.normalizeErrorResponse(status, headers, payload);
12743
12720
  var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);
12744
12721
 
12745
- if (false) {
12722
+ if ((0, _emberDataPrivateFeatures.default)('ds-extended-errors')) {
12746
12723
  switch (status) {
12747
12724
  case 401:
12748
12725
  return new _emberDataAdaptersErrors.UnauthorizedError(errors, detailedMessage);
@@ -12822,17 +12799,25 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12822
12799
  var hash = adapter.ajaxOptions(url, type, options);
12823
12800
 
12824
12801
  hash.success = function (payload, textStatus, jqXHR) {
12825
- var response = ajaxSuccess(adapter, jqXHR, payload, requestData);
12826
- _ember.default.run.join(null, resolve, response);
12802
+ try {
12803
+ var response = ajaxSuccess(adapter, jqXHR, payload, requestData);
12804
+ _ember.default.run.join(null, resolve, response);
12805
+ } catch (error) {
12806
+ _ember.default.run.join(null, reject, error);
12807
+ }
12827
12808
  };
12828
12809
 
12829
12810
  hash.error = function (jqXHR, textStatus, errorThrown) {
12830
- var responseData = {
12831
- textStatus: textStatus,
12832
- errorThrown: errorThrown
12833
- };
12834
- var error = ajaxError(adapter, jqXHR, requestData, responseData);
12835
- _ember.default.run.join(null, reject, error);
12811
+ try {
12812
+ var responseData = {
12813
+ textStatus: textStatus,
12814
+ errorThrown: errorThrown
12815
+ };
12816
+ var error = ajaxError(adapter, jqXHR, requestData, responseData);
12817
+ _ember.default.run.join(null, reject, error);
12818
+ } catch (error) {
12819
+ _ember.default.run.join(null, reject, error);
12820
+ }
12836
12821
  };
12837
12822
 
12838
12823
  adapter._ajaxRequest(hash);
@@ -12981,7 +12966,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12981
12966
  }
12982
12967
  });
12983
12968
 
12984
- if (false) {
12969
+ if (true) {
12985
12970
 
12986
12971
  RESTAdapter.reopen({
12987
12972
 
@@ -13204,17 +13189,25 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
13204
13189
  return new _ember.default.RSVP.Promise(function (resolve, reject) {
13205
13190
 
13206
13191
  hash.success = function (payload, textStatus, jqXHR) {
13207
- var response = ajaxSuccess(adapter, jqXHR, payload, requestData);
13208
- _ember.default.run.join(null, resolve, response);
13192
+ try {
13193
+ var response = ajaxSuccess(adapter, jqXHR, payload, requestData);
13194
+ _ember.default.run.join(null, resolve, response);
13195
+ } catch (error) {
13196
+ _ember.default.run.join(null, reject, error);
13197
+ }
13209
13198
  };
13210
13199
 
13211
13200
  hash.error = function (jqXHR, textStatus, errorThrown) {
13212
- var responseData = {
13213
- textStatus: textStatus,
13214
- errorThrown: errorThrown
13215
- };
13216
- var error = ajaxError(adapter, jqXHR, requestData, responseData);
13217
- _ember.default.run.join(null, reject, error);
13201
+ try {
13202
+ var responseData = {
13203
+ textStatus: textStatus,
13204
+ errorThrown: errorThrown
13205
+ };
13206
+ var error = ajaxError(adapter, jqXHR, requestData, responseData);
13207
+ _ember.default.run.join(null, reject, error);
13208
+ } catch (error) {
13209
+ _ember.default.run.join(null, reject, error);
13210
+ }
13218
13211
  };
13219
13212
 
13220
13213
  adapter._ajaxRequest(hash);
@@ -13224,12 +13217,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
13224
13217
  }
13225
13218
 
13226
13219
  function ajaxSuccess(adapter, jqXHR, payload, requestData) {
13227
- var response = undefined;
13228
- try {
13229
- response = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);
13230
- } catch (error) {
13231
- return Promise.reject(error);
13232
- }
13220
+ var response = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);
13233
13221
 
13234
13222
  if (response && response.isAdapterError) {
13235
13223
  return Promise.reject(response);
@@ -13256,11 +13244,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
13256
13244
  } else if (responseData.textStatus === 'abort') {
13257
13245
  error = new _emberDataAdaptersErrors.AbortError();
13258
13246
  } else {
13259
- try {
13260
- error = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), adapter.parseErrorResponse(jqXHR.responseText) || responseData.errorThrown, requestData);
13261
- } catch (e) {
13262
- error = e;
13263
- }
13247
+ error = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), adapter.parseErrorResponse(jqXHR.responseText) || responseData.errorThrown, requestData);
13264
13248
  }
13265
13249
 
13266
13250
  return error;
@@ -13445,7 +13429,7 @@ define('ember-data/attr', ['exports', 'ember', 'ember-data/-private/debug'], fun
13445
13429
  }).meta(meta);
13446
13430
  }
13447
13431
  });
13448
- define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/features", "ember-data/-private/global", "ember-data/-private/core", "ember-data/-private/system/normalize-model-name", "ember-data/-private/system/model/internal-model", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/store", "ember-data/-private/system/model", "ember-data/model", "ember-data/-private/system/snapshot", "ember-data/adapter", "ember-data/serializer", "ember-data/-private/system/debug", "ember-data/adapters/errors", "ember-data/-private/system/record-arrays", "ember-data/-private/system/many-array", "ember-data/-private/system/record-array-manager", "ember-data/-private/adapters", "ember-data/-private/adapters/build-url-mixin", "ember-data/-private/serializers", "ember-inflector", "ember-data/serializers/embedded-records-mixin", "ember-data/-private/transforms", "ember-data/relationships", "ember-data/setup-container", "ember-data/-private/instance-initializers/initialize-store-service", "ember-data/-private/system/container-proxy", "ember-data/-private/system/relationships/state/relationship"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures, _emberDataPrivateGlobal, _emberDataPrivateCore, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStore, _emberDataPrivateSystemModel, _emberDataModel, _emberDataPrivateSystemSnapshot, _emberDataAdapter, _emberDataSerializer, _emberDataPrivateSystemDebug, _emberDataAdaptersErrors, _emberDataPrivateSystemRecordArrays, _emberDataPrivateSystemManyArray, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateAdapters, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateSerializers, _emberInflector, _emberDataSerializersEmbeddedRecordsMixin, _emberDataPrivateTransforms, _emberDataRelationships, _emberDataSetupContainer, _emberDataPrivateInstanceInitializersInitializeStoreService, _emberDataPrivateSystemContainerProxy, _emberDataPrivateSystemRelationshipsStateRelationship) {
13432
+ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/features", "ember-data/-private/global", "ember-data/-private/core", "ember-data/-private/system/normalize-model-name", "ember-data/-private/system/model/internal-model", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/store", "ember-data/-private/system/model", "ember-data/model", "ember-data/-private/system/snapshot", "ember-data/adapter", "ember-data/serializer", "ember-data/-private/system/debug", "ember-data/adapters/errors", "ember-data/-private/system/record-arrays", "ember-data/-private/system/many-array", "ember-data/-private/system/record-array-manager", "ember-data/-private/adapters", "ember-data/-private/adapters/build-url-mixin", "ember-data/-private/serializers", "ember-inflector", "ember-data/serializers/embedded-records-mixin", "ember-data/-private/transforms", "ember-data/relationships", "ember-data/setup-container", "ember-data/-private/instance-initializers/initialize-store-service", "ember-data/-private/system/relationships/state/relationship"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures, _emberDataPrivateGlobal, _emberDataPrivateCore, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStore, _emberDataPrivateSystemModel, _emberDataModel, _emberDataPrivateSystemSnapshot, _emberDataAdapter, _emberDataSerializer, _emberDataPrivateSystemDebug, _emberDataAdaptersErrors, _emberDataPrivateSystemRecordArrays, _emberDataPrivateSystemManyArray, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateAdapters, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateSerializers, _emberInflector, _emberDataSerializersEmbeddedRecordsMixin, _emberDataPrivateTransforms, _emberDataRelationships, _emberDataSetupContainer, _emberDataPrivateInstanceInitializersInitializeStoreService, _emberDataPrivateSystemRelationshipsStateRelationship) {
13449
13433
 
13450
13434
  /**
13451
13435
  Ember Data
@@ -13478,7 +13462,7 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
13478
13462
  _emberDataPrivateCore.default.TimeoutError = _emberDataAdaptersErrors.TimeoutError;
13479
13463
  _emberDataPrivateCore.default.AbortError = _emberDataAdaptersErrors.AbortError;
13480
13464
 
13481
- if (false) {
13465
+ if ((0, _emberDataPrivateFeatures.default)('ds-extended-errors')) {
13482
13466
  _emberDataPrivateCore.default.UnauthorizedError = _emberDataAdaptersErrors.UnauthorizedError;
13483
13467
  _emberDataPrivateCore.default.ForbiddenError = _emberDataAdaptersErrors.ForbiddenError;
13484
13468
  _emberDataPrivateCore.default.NotFoundError = _emberDataAdaptersErrors.NotFoundError;
@@ -13522,8 +13506,6 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
13522
13506
 
13523
13507
  _emberDataPrivateCore.default.Relationship = _emberDataPrivateSystemRelationshipsStateRelationship.default;
13524
13508
 
13525
- _emberDataPrivateCore.default.ContainerProxy = _emberDataPrivateSystemContainerProxy.default;
13526
-
13527
13509
  _emberDataPrivateCore.default._setupContainer = _emberDataSetupContainer.default;
13528
13510
  _emberDataPrivateCore.default._initializeStoreService = _emberDataPrivateInstanceInitializersInitializeStoreService.default;
13529
13511
 
@@ -14461,7 +14443,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14461
14443
  @private
14462
14444
  */
14463
14445
  _normalizeRelationshipDataHelper: function (relationshipDataHash) {
14464
- if (false) {
14446
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14465
14447
  var modelName = this.modelNameFromPayloadType(relationshipDataHash.type);
14466
14448
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(relationshipDataHash.type);
14467
14449
 
@@ -14497,7 +14479,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14497
14479
  var modelName = undefined,
14498
14480
  usedLookup = undefined;
14499
14481
 
14500
- if (false) {
14482
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14501
14483
  modelName = this.modelNameFromPayloadType(resourceHash.type);
14502
14484
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(resourceHash.type);
14503
14485
 
@@ -14541,7 +14523,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14541
14523
  */
14542
14524
  pushPayload: function (store, payload) {
14543
14525
  var normalizedPayload = this._normalizeDocumentHelper(payload);
14544
- if (false) {
14526
+ if ((0, _emberDataPrivateFeatures.default)('ds-pushpayload-return')) {
14545
14527
  return store.push(normalizedPayload);
14546
14528
  } else {
14547
14529
  store.push(normalizedPayload);
@@ -14655,7 +14637,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14655
14637
  @private
14656
14638
  */
14657
14639
  _extractType: function (modelClass, resourceHash) {
14658
- if (false) {
14640
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14659
14641
  var modelName = this.modelNameFromPayloadType(resourceHash.type);
14660
14642
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(resourceHash.type);
14661
14643
 
@@ -14782,7 +14764,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14782
14764
  var data = this._super.apply(this, arguments);
14783
14765
 
14784
14766
  var payloadType = undefined;
14785
- if (false) {
14767
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14786
14768
  payloadType = this.payloadTypeFromModelName(snapshot.modelName);
14787
14769
  var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(snapshot.modelName);
14788
14770
 
@@ -14855,7 +14837,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14855
14837
  if (belongsTo) {
14856
14838
  var payloadType = undefined;
14857
14839
 
14858
- if (false) {
14840
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14859
14841
  payloadType = this.payloadTypeFromModelName(belongsTo.modelName);
14860
14842
  var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(belongsTo.modelName);
14861
14843
 
@@ -14891,7 +14873,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14891
14873
  serializeHasMany: function (snapshot, json, relationship) {
14892
14874
  var key = relationship.key;
14893
14875
  var shouldSerializeHasMany = '_shouldSerializeHasMany';
14894
- if (false) {
14876
+ if ((0, _emberDataPrivateFeatures.default)("ds-check-should-serialize-relationships")) {
14895
14877
  shouldSerializeHasMany = 'shouldSerializeHasMany';
14896
14878
  }
14897
14879
 
@@ -14913,7 +14895,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14913
14895
 
14914
14896
  var payloadType = undefined;
14915
14897
 
14916
- if (false) {
14898
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14917
14899
  payloadType = this.payloadTypeFromModelName(item.modelName);
14918
14900
  var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(item.modelName);
14919
14901
 
@@ -14941,7 +14923,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
14941
14923
  }
14942
14924
  });
14943
14925
 
14944
- if (false) {
14926
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
14945
14927
 
14946
14928
  JSONAPISerializer.reopen({
14947
14929
 
@@ -15638,7 +15620,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
15638
15620
  var modelClass = this.store.modelFor(relationshipModelName);
15639
15621
  if (relationshipHash.type && !(0, _emberDataPrivateUtils.modelHasAttributeOrRelationshipNamedType)(modelClass)) {
15640
15622
 
15641
- if (false) {
15623
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
15642
15624
  var modelName = this.modelNameFromPayloadType(relationshipHash.type);
15643
15625
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(relationshipHash.type);
15644
15626
 
@@ -16208,7 +16190,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
16208
16190
  serializeHasMany: function (snapshot, json, relationship) {
16209
16191
  var key = relationship.key;
16210
16192
  var shouldSerializeHasMany = '_shouldSerializeHasMany';
16211
- if (false) {
16193
+ if ((0, _emberDataPrivateFeatures.default)("ds-check-should-serialize-relationships")) {
16212
16194
  shouldSerializeHasMany = 'shouldSerializeHasMany';
16213
16195
  }
16214
16196
 
@@ -16461,7 +16443,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
16461
16443
  }
16462
16444
  });
16463
16445
 
16464
- if (false) {
16446
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
16465
16447
 
16466
16448
  JSONSerializer.reopen({
16467
16449
 
@@ -16672,7 +16654,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
16672
16654
  if (!primaryHasTypeAttribute && hash.type) {
16673
16655
  // Support polymorphic records in async relationships
16674
16656
  var modelName = undefined;
16675
- if (false) {
16657
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
16676
16658
  modelName = this.modelNameFromPayloadType(hash.type);
16677
16659
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(hash.type);
16678
16660
 
@@ -16909,7 +16891,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
16909
16891
  });
16910
16892
  }
16911
16893
 
16912
- if (false) {
16894
+ if ((0, _emberDataPrivateFeatures.default)('ds-pushpayload-return')) {
16913
16895
  return store.push(documentHash);
16914
16896
  } else {
16915
16897
  store.push(documentHash);
@@ -17188,7 +17170,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
17188
17170
  if (_ember.default.isNone(belongsTo)) {
17189
17171
  json[typeKey] = null;
17190
17172
  } else {
17191
- if (false) {
17173
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
17192
17174
  json[typeKey] = this.payloadTypeFromModelName(belongsTo.modelName);
17193
17175
  } else {
17194
17176
  json[typeKey] = camelize(belongsTo.modelName);
@@ -17232,7 +17214,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
17232
17214
 
17233
17215
  if (isPolymorphic && resourceHash[typeProperty] !== undefined && typeof relationshipHash !== 'object') {
17234
17216
 
17235
- if (false) {
17217
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
17236
17218
 
17237
17219
  var payloadType = resourceHash[typeProperty];
17238
17220
  var type = this.modelNameFromPayloadType(payloadType);
@@ -17265,7 +17247,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
17265
17247
  }
17266
17248
  });
17267
17249
 
17268
- if (false) {
17250
+ if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
17269
17251
 
17270
17252
  RESTSerializer.reopen({
17271
17253
 
@@ -17412,15 +17394,44 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
17412
17394
 
17413
17395
  // Converts centigrade in the JSON to fahrenheit in the app
17414
17396
  export default DS.Transform.extend({
17415
- deserialize: function(serialized) {
17397
+ deserialize: function(serialized, options) {
17416
17398
  return (serialized * 1.8) + 32;
17417
17399
  },
17418
- serialize: function(deserialized) {
17400
+ serialize: function(deserialized, options) {
17419
17401
  return (deserialized - 32) / 1.8;
17420
17402
  }
17421
17403
  });
17422
17404
  ```
17423
17405
 
17406
+ The options passed into the `DS.attr` function when the attribute is
17407
+ declared on the model is also available in the transform.
17408
+
17409
+ ```app/models/post.js
17410
+ export default DS.Model.extend({
17411
+ title: DS.attr('string'),
17412
+ markdown: DS.attr('markdown', {
17413
+ markdown: {
17414
+ gfm: false,
17415
+ sanitize: true
17416
+ }
17417
+ })
17418
+ });
17419
+ ```
17420
+
17421
+ ```app/transforms/markdown.js
17422
+ export default DS.Transform.extend({
17423
+ serialize: function (deserialized, options) {
17424
+ return deserialized.raw;
17425
+ },
17426
+
17427
+ deserialize: function (serialized, options) {
17428
+ var markdownOptions = options.markdown || {};
17429
+
17430
+ return marked(serialized, markdownOptions);
17431
+ }
17432
+ });
17433
+ ```
17434
+
17424
17435
  Usage
17425
17436
 
17426
17437
  ```app/models/requirement.js
@@ -17470,7 +17481,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
17470
17481
  });
17471
17482
  });
17472
17483
  define("ember-data/version", ["exports"], function (exports) {
17473
- exports.default = "2.8.1";
17484
+ exports.default = "2.9.0-beta.1";
17474
17485
  });
17475
17486
  define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
17476
17487