ember-data-source 2.7.0 → 2.8.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: 50f486c2046dbedace3a3b7b7c3bdae5893ccb71
4
- data.tar.gz: af02c9a71208ce5c388e52741e4c8f6bc9995692
3
+ metadata.gz: f7aea2cd9461e6028892ed6b47c34af2674ba786
4
+ data.tar.gz: f3fe96c869fb2df1de337d48bc5d763abfda21b1
5
5
  SHA512:
6
- metadata.gz: f34b44f9d37c92b0197de178c245ec502741d5e1c8b83253c73fa8525aa61104fec8735205bbba86813e5ad01a0ff1ac09313aaebc0f876713e897ab1d4f6725
7
- data.tar.gz: ebc241b8a37c76cc007fa9d3808088be0e3be1ddbab68ebf782943bb9b6d0bbe59b2b5cef83645e7c575cfde30d555009f6110a06026fecdc8fa00fb1064cfa8
6
+ metadata.gz: 222f69931db48b40293e01555996944e26fb7bdd44df45c99f7acf5f93fab8130691ea9cdb986fcb07b793f2115b1265d55a807650540e3f5e4de54093227b3d
7
+ data.tar.gz: 464ffb085fa2eef04ebb1895d168984fc0dcec492dc5f417b331a3f95a2fa3d302483ac8ddd00913f3bb29ff4d93b5da38af4410fe6ea4613d66256218c6e2d1
@@ -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.7.0
9
+ * @version 2.8.0-beta.1
10
10
  */
11
11
 
12
12
  var loader, define, requireModule, require, requirejs;
@@ -609,7 +609,7 @@ define('ember-data/-private/core', ['exports', 'ember', 'ember-data/version'], f
609
609
  */
610
610
 
611
611
  /**
612
- All Ember Data methods and functions are defined inside of this namespace.
612
+ All Ember Data classes, methods and functions are defined inside of this namespace.
613
613
 
614
614
  @class DS
615
615
  @static
@@ -681,7 +681,7 @@ define('ember-data/-private/debug', ['exports', 'ember'], function (exports, _em
681
681
  return typeClass.detect(addedRecord.type);
682
682
  }
683
683
 
684
- /**
684
+ /*
685
685
  Assert that `addedRecord` has a valid type so it can be added to the
686
686
  relationship of the `record`.
687
687
 
@@ -714,6 +714,18 @@ define('ember-data/-private/debug', ['exports', 'ember'], function (exports, _em
714
714
  });
715
715
  define('ember-data/-private/ext/date', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
716
716
 
717
+ /**
718
+ Date.parse with progressive enhancement for ISO 8601 <https://github.com/csnover/js-iso8601>
719
+
720
+ © 2011 Colin Snover <http://zetafleet.com>
721
+
722
+ Released under MIT license.
723
+
724
+ @class Date
725
+ @namespace Ember
726
+ @static
727
+ @deprecated
728
+ */
717
729
  _ember.default.Date = _ember.default.Date || {};
718
730
 
719
731
  var origParse = Date.parse;
@@ -806,11 +818,11 @@ define('ember-data/-private/global', ['exports'], function (exports) {
806
818
  define("ember-data/-private/initializers/data-adapter", ["exports", "ember-data/-private/system/debug/debug-adapter"], function (exports, _emberDataPrivateSystemDebugDebugAdapter) {
807
819
  exports.default = initializeDebugAdapter;
808
820
 
809
- /**
821
+ /*
810
822
  Configures a registry with injections on Ember applications
811
823
  for the Ember-Data store. Accepts an optional namespace argument.
812
824
 
813
- @method initializeStoreInjections
825
+ @method initializeDebugAdapter
814
826
  @param {Ember.Registry} registry
815
827
  */
816
828
 
@@ -820,7 +832,7 @@ define("ember-data/-private/initializers/data-adapter", ["exports", "ember-data/
820
832
  });
821
833
  define('ember-data/-private/initializers/store-injections', ['exports'], function (exports) {
822
834
  exports.default = initializeStoreInjections;
823
- /**
835
+ /*
824
836
  Configures a registry with injections on Ember applications
825
837
  for the Ember-Data store. Accepts an optional namespace argument.
826
838
 
@@ -850,7 +862,7 @@ define("ember-data/-private/initializers/store", ["exports", "ember-data/-privat
850
862
  }
851
863
  }
852
864
 
853
- /**
865
+ /*
854
866
  Configures a registry for use with an Ember-Data
855
867
  store. Accepts an optional namespace argument.
856
868
 
@@ -880,7 +892,7 @@ define("ember-data/-private/initializers/store", ["exports", "ember-data/-privat
880
892
  define('ember-data/-private/initializers/transforms', ['exports', 'ember-data/-private/transforms'], function (exports, _emberDataPrivateTransforms) {
881
893
  exports.default = initializeTransforms;
882
894
 
883
- /**
895
+ /*
884
896
  Configures a registry for use with Ember-Data
885
897
  transforms.
886
898
 
@@ -897,11 +909,11 @@ define('ember-data/-private/initializers/transforms', ['exports', 'ember-data/-p
897
909
  });
898
910
  define('ember-data/-private/instance-initializers/initialize-store-service', ['exports'], function (exports) {
899
911
  exports.default = initializeStoreService;
900
- /**
912
+ /*
901
913
  Configures a registry for use with an Ember-Data
902
914
  store.
903
915
 
904
- @method initializeStore
916
+ @method initializeStoreService
905
917
  @param {Ember.ApplicationInstance} applicationOrRegistry
906
918
  */
907
919
 
@@ -2144,7 +2156,7 @@ define('ember-data/-private/system/model/errors', ['exports', 'ember', 'ember-da
2144
2156
  }
2145
2157
  });
2146
2158
  });
2147
- define("ember-data/-private/system/model/internal-model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/model/states", "ember-data/-private/system/relationships/state/create", "ember-data/-private/system/snapshot", "ember-data/-private/system/empty-object", "ember-data/-private/utils", "ember-data/-private/system/references"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemModelStates, _emberDataPrivateSystemRelationshipsStateCreate, _emberDataPrivateSystemSnapshot, _emberDataPrivateSystemEmptyObject, _emberDataPrivateUtils, _emberDataPrivateSystemReferences) {
2159
+ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/model/states", "ember-data/-private/system/relationships/state/create", "ember-data/-private/system/snapshot", "ember-data/-private/system/empty-object", "ember-data/-private/features", "ember-data/-private/utils", "ember-data/-private/system/references"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemModelStates, _emberDataPrivateSystemRelationshipsStateCreate, _emberDataPrivateSystemSnapshot, _emberDataPrivateSystemEmptyObject, _emberDataPrivateFeatures, _emberDataPrivateUtils, _emberDataPrivateSystemReferences) {
2148
2160
  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();
2149
2161
 
2150
2162
  exports.default = InternalModel;
@@ -2558,6 +2570,7 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
2558
2570
 
2559
2571
  this.record._notifyProperties(dirtyKeys);
2560
2572
  },
2573
+
2561
2574
  /*
2562
2575
  @method transitionTo
2563
2576
  @private
@@ -2976,8 +2989,24 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
2976
2989
  return reference;
2977
2990
  }
2978
2991
  };
2992
+
2993
+ if (false) {
2994
+ /*
2995
+ Returns the latest truth for an attribute - the canonical value, or the
2996
+ in-flight value.
2997
+ @method lastAcknowledgedValue
2998
+ @private
2999
+ */
3000
+ InternalModel.prototype.lastAcknowledgedValue = function lastAcknowledgedValue(key) {
3001
+ if (key in this._inFlightAttributes) {
3002
+ return this._inFlightAttributes[key];
3003
+ } else {
3004
+ return this._data[key];
3005
+ }
3006
+ };
3007
+ }
2979
3008
  });
2980
- define("ember-data/-private/system/model/model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/model/errors", "ember-data/-private/system/debug/debug-info", "ember-data/-private/system/relationships/belongs-to", "ember-data/-private/system/relationships/has-many", "ember-data/-private/system/relationships/ext", "ember-data/-private/system/model/attr"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemModelErrors, _emberDataPrivateSystemDebugDebugInfo, _emberDataPrivateSystemRelationshipsBelongsTo, _emberDataPrivateSystemRelationshipsHasMany, _emberDataPrivateSystemRelationshipsExt, _emberDataPrivateSystemModelAttr) {
3009
+ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/model/errors", "ember-data/-private/system/debug/debug-info", "ember-data/-private/system/relationships/belongs-to", "ember-data/-private/system/relationships/has-many", "ember-data/-private/system/relationships/ext", "ember-data/-private/system/model/attr", "ember-data/-private/features"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemModelErrors, _emberDataPrivateSystemDebugDebugInfo, _emberDataPrivateSystemRelationshipsBelongsTo, _emberDataPrivateSystemRelationshipsHasMany, _emberDataPrivateSystemRelationshipsExt, _emberDataPrivateSystemModelAttr, _emberDataPrivateFeatures) {
2981
3010
 
2982
3011
  /**
2983
3012
  @module ember-data
@@ -3871,6 +3900,28 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3871
3900
  });
3872
3901
  }
3873
3902
 
3903
+ if (false) {
3904
+ Model.reopen({
3905
+ /**
3906
+ Discards any unsaved changes to the given attribute.
3907
+ Example
3908
+ ```javascript
3909
+ record.get('name'); // 'Untitled Document'
3910
+ record.set('name', 'Doc 1');
3911
+ record.get('name'); // 'Doc 1'
3912
+ record.resetAttribute('name');
3913
+ record.get('name'); // 'Untitled Document'
3914
+ ```
3915
+ @method resetAttribute
3916
+ */
3917
+ resetAttribute: function (attributeName) {
3918
+ if (attributeName in this._internalModel._attributes) {
3919
+ this.set(attributeName, this._internalModel.lastAcknowledgedValue(attributeName));
3920
+ }
3921
+ }
3922
+ });
3923
+ }
3924
+
3874
3925
  Model.reopenClass(_emberDataPrivateSystemRelationshipsExt.RelationshipsClassMethodsMixin);
3875
3926
  Model.reopenClass(_emberDataPrivateSystemModelAttr.AttrClassMethodsMixin);
3876
3927
 
@@ -4097,7 +4148,7 @@ define('ember-data/-private/system/model/states', ['exports', 'ember', 'ember-da
4097
4148
  // `inFlight`: the store has handed off the record to be saved,
4098
4149
  // but the adapter has not yet acknowledged success.
4099
4150
  // `invalid`: the record has invalid information and cannot be
4100
- // send to the adapter yet.
4151
+ // sent to the adapter yet.
4101
4152
  var DirtyState = {
4102
4153
  initialState: 'uncommitted',
4103
4154
 
@@ -4643,7 +4694,7 @@ define('ember-data/-private/system/model/states', ['exports', 'ember', 'ember-da
4643
4694
  */
4644
4695
  define('ember-data/-private/system/normalize-link', ['exports'], function (exports) {
4645
4696
  exports.default = _normalizeLink;
4646
- /**
4697
+ /*
4647
4698
  This method normalizes a link to an "links object". If the passed link is
4648
4699
  already an object it's returned without any modifications.
4649
4700
 
@@ -9368,7 +9419,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9368
9419
  this._backburner.schedule('normalizeRelationships', this, '_setupRelationships', internalModel, data);
9369
9420
  this.updateId(internalModel, data);
9370
9421
  }
9371
-
9422
+ (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);
9372
9423
  //We first make sure the primary data has been updated
9373
9424
  //TODO try to move notification to the user to the end of the runloop
9374
9425
  internalModel.adapterDidCommit(data);
@@ -10780,7 +10831,7 @@ define('ember-data/-private/utils', ['exports', 'ember'], function (exports, _em
10780
10831
 
10781
10832
  var get = _ember.default.get;
10782
10833
 
10783
- /**
10834
+ /*
10784
10835
  Check if the passed model has a `type` attribute or a relationship named `type`.
10785
10836
 
10786
10837
  @method modelHasAttributeOrRelationshipNamedType
@@ -10948,9 +10999,8 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
10948
10999
  import DS from 'ember-data';
10949
11000
  export default DS.Adapter.extend({
10950
11001
  findRecord: function(store, type, id, snapshot) {
10951
- var url = [type.modelName, id].join('/');
10952
11002
  return new Ember.RSVP.Promise(function(resolve, reject) {
10953
- Ember.$.getJSON(url).then(function(data) {
11003
+ Ember.$.getJSON(`/${type.modelName}/${id}`).then(function(data) {
10954
11004
  Ember.run(null, resolve, data);
10955
11005
  }, function(jqXHR) {
10956
11006
  jqXHR.then = null; // tame jQuery's ill mannered promises
@@ -10976,10 +11026,9 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
10976
11026
  import DS from 'ember-data';
10977
11027
  export default DS.Adapter.extend({
10978
11028
  findAll: function(store, type, sinceToken) {
10979
- var url = type;
10980
11029
  var query = { since: sinceToken };
10981
11030
  return new Ember.RSVP.Promise(function(resolve, reject) {
10982
- Ember.$.getJSON(url, query).then(function(data) {
11031
+ Ember.$.getJSON(`/${type.modelName}`, query).then(function(data) {
10983
11032
  Ember.run(null, resolve, data);
10984
11033
  }, function(jqXHR) {
10985
11034
  jqXHR.then = null; // tame jQuery's ill mannered promises
@@ -11005,9 +11054,8 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11005
11054
  import DS from 'ember-data';
11006
11055
  export default DS.Adapter.extend({
11007
11056
  query: function(store, type, query) {
11008
- var url = type;
11009
11057
  return new Ember.RSVP.Promise(function(resolve, reject) {
11010
- Ember.$.getJSON(url, query).then(function(data) {
11058
+ Ember.$.getJSON(`/${type.modelName}`, query).then(function(data) {
11011
11059
  Ember.run(null, resolve, data);
11012
11060
  }, function(jqXHR) {
11013
11061
  jqXHR.then = null; // tame jQuery's ill mannered promises
@@ -11039,9 +11087,8 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11039
11087
  import Ember from 'ember';
11040
11088
  export default DS.Adapter.extend(DS.BuildURLMixin, {
11041
11089
  queryRecord: function(store, type, query) {
11042
- var urlForQueryRecord = this.buildURL(type.modelName, null, null, 'queryRecord', query);
11043
- return new Ember.RSVP.Promise(function(resolve, reject) {
11044
- Ember.$.getJSON(urlForQueryRecord, query).then(function(data) {
11090
+ return new Ember.RSVP.Promise(function(resolve, reject) {
11091
+ Ember.$.getJSON(`/${type.modelName}`, query).then(function(data) {
11045
11092
  Ember.run(null, resolve, data);
11046
11093
  }, function(jqXHR) {
11047
11094
  jqXHR.then = null; // tame jQuery's ill mannered promises
@@ -11071,10 +11118,13 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11071
11118
  The `generateIdForRecord()` method will be invoked with the requesting store as
11072
11119
  the first parameter and the newly created record as the second parameter:
11073
11120
  ```javascript
11074
- generateIdForRecord: function(store, inputProperties) {
11075
- var uuid = App.generateUUIDWithStatisticallyLowOddsOfCollision();
11076
- return uuid;
11077
- }
11121
+ import DS from 'ember-data';
11122
+ import { v4 } from 'uuid';
11123
+ export default DS.Adapter.extend({
11124
+ generateIdForRecord: function(store, inputProperties) {
11125
+ return v4();
11126
+ }
11127
+ });
11078
11128
  ```
11079
11129
  @method generateIdForRecord
11080
11130
  @param {DS.Store} store
@@ -11093,7 +11143,7 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11093
11143
  export default DS.Adapter.extend({
11094
11144
  createRecord: function(store, type, snapshot) {
11095
11145
  var data = this.serialize(snapshot, { includeId: true });
11096
- var url = type;
11146
+ var url = `/${type.modelName}`;
11097
11147
  // ...
11098
11148
  }
11099
11149
  });
@@ -11117,11 +11167,10 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11117
11167
  export default DS.Adapter.extend({
11118
11168
  createRecord: function(store, type, snapshot) {
11119
11169
  var data = this.serialize(snapshot, { includeId: true });
11120
- var url = type;
11121
11170
  return new Ember.RSVP.Promise(function(resolve, reject) {
11122
11171
  Ember.$.ajax({
11123
11172
  type: 'POST',
11124
- url: url,
11173
+ url: `/${type.modelName}`,
11125
11174
  dataType: 'json',
11126
11175
  data: data
11127
11176
  }).then(function(data) {
@@ -11160,11 +11209,10 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11160
11209
  updateRecord: function(store, type, snapshot) {
11161
11210
  var data = this.serialize(snapshot, { includeId: true });
11162
11211
  var id = snapshot.id;
11163
- var url = [type, id].join('/');
11164
11212
  return new Ember.RSVP.Promise(function(resolve, reject) {
11165
11213
  Ember.$.ajax({
11166
11214
  type: 'PUT',
11167
- url: url,
11215
+ url: `/${type.modelName}/${id}`,
11168
11216
  dataType: 'json',
11169
11217
  data: data
11170
11218
  }).then(function(data) {
@@ -11196,11 +11244,10 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11196
11244
  deleteRecord: function(store, type, snapshot) {
11197
11245
  var data = this.serialize(snapshot, { includeId: true });
11198
11246
  var id = snapshot.id;
11199
- var url = [type, id].join('/');
11200
11247
  return new Ember.RSVP.Promise(function(resolve, reject) {
11201
11248
  Ember.$.ajax({
11202
11249
  type: 'DELETE',
11203
- url: url,
11250
+ url: `/${type.modelName}/${id}`,
11204
11251
  dataType: 'json',
11205
11252
  data: data
11206
11253
  }).then(function(data) {
@@ -11232,7 +11279,29 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
11232
11279
  coalesceFindRequests: true,
11233
11280
 
11234
11281
  /**
11235
- Find multiple records at once if coalesceFindRequests is true.
11282
+ The store will call `findMany` instead of multiple `findRecord`
11283
+ requests to find multiple records at once if coalesceFindRequests
11284
+ is true.
11285
+ ```app/adapters/application.js
11286
+ import DS from 'ember-data';
11287
+ export default DS.Adapter.extend({
11288
+ findMany(store, type, ids, snapshots) {
11289
+ return new Ember.RSVP.Promise(function(resolve, reject) {
11290
+ Ember.$.ajax({
11291
+ type: 'GET',
11292
+ url: `/${type.modelName}/`,
11293
+ dataType: 'json',
11294
+ data: { filter: { id: ids.join(',') } }
11295
+ }).then(function(data) {
11296
+ Ember.run(null, resolve, data);
11297
+ }, function(jqXHR) {
11298
+ jqXHR.then = null; // tame jQuery's ill mannered promises
11299
+ Ember.run(null, reject, jqXHR);
11300
+ });
11301
+ });
11302
+ }
11303
+ });
11304
+ ```
11236
11305
  @method findMany
11237
11306
  @param {DS.Store} store
11238
11307
  @param {DS.Model} type the DS.Model class of the records
@@ -11726,7 +11795,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11726
11795
  @return {Promise} promise
11727
11796
  */
11728
11797
  findMany: function (store, type, ids, snapshots) {
11729
- if (false && !this._hasCustomizedAjax()) {
11798
+ if (true && !this._hasCustomizedAjax()) {
11730
11799
  return this._super.apply(this, arguments);
11731
11800
  } else {
11732
11801
  var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
@@ -11753,7 +11822,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11753
11822
  @return {Promise} promise
11754
11823
  */
11755
11824
  updateRecord: function (store, type, snapshot) {
11756
- if (false && !this._hasCustomizedAjax()) {
11825
+ if (true && !this._hasCustomizedAjax()) {
11757
11826
  return this._super.apply(this, arguments);
11758
11827
  } else {
11759
11828
  var data = {};
@@ -11789,7 +11858,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11789
11858
  }
11790
11859
  });
11791
11860
 
11792
- if (false) {
11861
+ if (true) {
11793
11862
 
11794
11863
  JSONAPIAdapter.reopen({
11795
11864
 
@@ -12215,7 +12284,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12215
12284
  @return {Promise} promise
12216
12285
  */
12217
12286
  findRecord: function (store, type, id, snapshot) {
12218
- if (false && !this._hasCustomizedAjax()) {
12287
+ if (true && !this._hasCustomizedAjax()) {
12219
12288
  var request = this._requestFor({
12220
12289
  store: store, type: type, id: id, snapshot: snapshot,
12221
12290
  requestType: 'findRecord'
@@ -12245,7 +12314,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12245
12314
  findAll: function (store, type, sinceToken, snapshotRecordArray) {
12246
12315
  var query = this.buildQuery(snapshotRecordArray);
12247
12316
 
12248
- if (false && !this._hasCustomizedAjax()) {
12317
+ if (true && !this._hasCustomizedAjax()) {
12249
12318
  var request = this._requestFor({
12250
12319
  store: store, type: type, sinceToken: sinceToken, query: query,
12251
12320
  snapshots: snapshotRecordArray,
@@ -12279,7 +12348,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12279
12348
  @return {Promise} promise
12280
12349
  */
12281
12350
  query: function (store, type, query) {
12282
- if (false && !this._hasCustomizedAjax()) {
12351
+ if (true && !this._hasCustomizedAjax()) {
12283
12352
  var request = this._requestFor({
12284
12353
  store: store, type: type, query: query,
12285
12354
  requestType: 'query'
@@ -12313,7 +12382,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12313
12382
  @return {Promise} promise
12314
12383
  */
12315
12384
  queryRecord: function (store, type, query) {
12316
- if (false && !this._hasCustomizedAjax()) {
12385
+ if (true && !this._hasCustomizedAjax()) {
12317
12386
  var request = this._requestFor({
12318
12387
  store: store, type: type, query: query,
12319
12388
  requestType: 'queryRecord'
@@ -12358,7 +12427,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12358
12427
  @return {Promise} promise
12359
12428
  */
12360
12429
  findMany: function (store, type, ids, snapshots) {
12361
- if (false && !this._hasCustomizedAjax()) {
12430
+ if (true && !this._hasCustomizedAjax()) {
12362
12431
  var request = this._requestFor({
12363
12432
  store: store, type: type, ids: ids, snapshots: snapshots,
12364
12433
  requestType: 'findMany'
@@ -12398,7 +12467,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12398
12467
  @return {Promise} promise
12399
12468
  */
12400
12469
  findHasMany: function (store, snapshot, url, relationship) {
12401
- if (false && !this._hasCustomizedAjax()) {
12470
+ if (true && !this._hasCustomizedAjax()) {
12402
12471
  var request = this._requestFor({
12403
12472
  store: store, snapshot: snapshot, url: url, relationship: relationship,
12404
12473
  requestType: 'findHasMany'
@@ -12442,7 +12511,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12442
12511
  @return {Promise} promise
12443
12512
  */
12444
12513
  findBelongsTo: function (store, snapshot, url, relationship) {
12445
- if (false && !this._hasCustomizedAjax()) {
12514
+ if (true && !this._hasCustomizedAjax()) {
12446
12515
  var request = this._requestFor({
12447
12516
  store: store, snapshot: snapshot, url: url, relationship: relationship,
12448
12517
  requestType: 'findBelongsTo'
@@ -12472,7 +12541,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12472
12541
  @return {Promise} promise
12473
12542
  */
12474
12543
  createRecord: function (store, type, snapshot) {
12475
- if (false && !this._hasCustomizedAjax()) {
12544
+ if (true && !this._hasCustomizedAjax()) {
12476
12545
  var request = this._requestFor({
12477
12546
  store: store, type: type, snapshot: snapshot,
12478
12547
  requestType: 'createRecord'
@@ -12504,7 +12573,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12504
12573
  @return {Promise} promise
12505
12574
  */
12506
12575
  updateRecord: function (store, type, snapshot) {
12507
- if (false && !this._hasCustomizedAjax()) {
12576
+ if (true && !this._hasCustomizedAjax()) {
12508
12577
  var request = this._requestFor({
12509
12578
  store: store, type: type, snapshot: snapshot,
12510
12579
  requestType: 'updateRecord'
@@ -12534,7 +12603,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12534
12603
  @return {Promise} promise
12535
12604
  */
12536
12605
  deleteRecord: function (store, type, snapshot) {
12537
- if (false && !this._hasCustomizedAjax()) {
12606
+ if (true && !this._hasCustomizedAjax()) {
12538
12607
  var request = this._requestFor({
12539
12608
  store: store, type: type, snapshot: snapshot,
12540
12609
  requestType: 'deleteRecord'
@@ -12930,7 +12999,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12930
12999
  }
12931
13000
  });
12932
13001
 
12933
- if (false) {
13002
+ if (true) {
12934
13003
 
12935
13004
  RESTAdapter.reopen({
12936
13005
 
@@ -13471,6 +13540,111 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
13471
13540
 
13472
13541
  exports.default = _emberDataPrivateCore.default;
13473
13542
  });
13543
+ define('ember-data/initializers/data-adapter', ['exports', 'ember'], function (exports, _ember) {
13544
+
13545
+ /*
13546
+ This initializer is here to keep backwards compatibility with code depending
13547
+ on the `data-adapter` initializer (before Ember Data was an addon).
13548
+
13549
+ Should be removed for Ember Data 3.x
13550
+ */
13551
+
13552
+ exports.default = {
13553
+ name: 'data-adapter',
13554
+ before: 'store',
13555
+ initialize: _ember.default.K
13556
+ };
13557
+ });
13558
+ define('ember-data/initializers/ember-data', ['exports', 'ember-data/setup-container', 'ember-data/-private/core'], function (exports, _emberDataSetupContainer, _emberDataPrivateCore) {
13559
+
13560
+ /*
13561
+
13562
+ This code initializes Ember-Data onto an Ember application.
13563
+
13564
+ If an Ember.js developer defines a subclass of DS.Store on their application,
13565
+ as `App.StoreService` (or via a module system that resolves to `service:store`)
13566
+ this code will automatically instantiate it and make it available on the
13567
+ router.
13568
+
13569
+ Additionally, after an application's controllers have been injected, they will
13570
+ each have the store made available to them.
13571
+
13572
+ For example, imagine an Ember.js application with the following classes:
13573
+
13574
+ App.StoreService = DS.Store.extend({
13575
+ adapter: 'custom'
13576
+ });
13577
+
13578
+ App.PostsController = Ember.ArrayController.extend({
13579
+ // ...
13580
+ });
13581
+
13582
+ When the application is initialized, `App.ApplicationStore` will automatically be
13583
+ instantiated, and the instance of `App.PostsController` will have its `store`
13584
+ property set to that instance.
13585
+
13586
+ Note that this code will only be run if the `ember-application` package is
13587
+ loaded. If Ember Data is being used in an environment other than a
13588
+ typical application (e.g., node.js where only `ember-runtime` is available),
13589
+ this code will be ignored.
13590
+ */
13591
+
13592
+ exports.default = {
13593
+ name: 'ember-data',
13594
+ initialize: _emberDataSetupContainer.default
13595
+ };
13596
+ });
13597
+ define('ember-data/initializers/injectStore', ['exports', 'ember'], function (exports, _ember) {
13598
+
13599
+ /*
13600
+ This initializer is here to keep backwards compatibility with code depending
13601
+ on the `injectStore` initializer (before Ember Data was an addon).
13602
+
13603
+ Should be removed for Ember Data 3.x
13604
+ */
13605
+
13606
+ exports.default = {
13607
+ name: 'injectStore',
13608
+ before: 'store',
13609
+ initialize: _ember.default.K
13610
+ };
13611
+ });
13612
+ define('ember-data/initializers/store', ['exports', 'ember'], function (exports, _ember) {
13613
+
13614
+ /*
13615
+ This initializer is here to keep backwards compatibility with code depending
13616
+ on the `store` initializer (before Ember Data was an addon).
13617
+
13618
+ Should be removed for Ember Data 3.x
13619
+ */
13620
+
13621
+ exports.default = {
13622
+ name: 'store',
13623
+ after: 'ember-data',
13624
+ initialize: _ember.default.K
13625
+ };
13626
+ });
13627
+ define('ember-data/initializers/transforms', ['exports', 'ember'], function (exports, _ember) {
13628
+
13629
+ /*
13630
+ This initializer is here to keep backwards compatibility with code depending
13631
+ on the `transforms` initializer (before Ember Data was an addon).
13632
+
13633
+ Should be removed for Ember Data 3.x
13634
+ */
13635
+
13636
+ exports.default = {
13637
+ name: 'transforms',
13638
+ before: 'store',
13639
+ initialize: _ember.default.K
13640
+ };
13641
+ });
13642
+ define("ember-data/instance-initializers/ember-data", ["exports", "ember-data/-private/instance-initializers/initialize-store-service"], function (exports, _emberDataPrivateInstanceInitializersInitializeStoreService) {
13643
+ exports.default = {
13644
+ name: "ember-data",
13645
+ initialize: _emberDataPrivateInstanceInitializersInitializeStoreService.default
13646
+ };
13647
+ });
13474
13648
  define("ember-data/model", ["exports", "ember-data/-private/system/model"], function (exports, _emberDataPrivateSystemModel) {
13475
13649
  exports.default = _emberDataPrivateSystemModel.default;
13476
13650
  });
@@ -13562,7 +13736,7 @@ define('ember-data/serializer', ['exports', 'ember'], function (exports, _ember)
13562
13736
  /**
13563
13737
  @module ember-data
13564
13738
  */
13565
- define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures) {
13739
+ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
13566
13740
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
13567
13741
 
13568
13742
  var get = _ember.default.get;
@@ -13891,7 +14065,6 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
13891
14065
  }
13892
14066
  }
13893
14067
  ```
13894
- Note that the `ids-and-types` strategy is still behind the `ds-serialize-ids-and-types` feature flag.
13895
14068
  @method serializeHasMany
13896
14069
  @param {DS.Snapshot} snapshot
13897
14070
  @param {Object} json
@@ -13910,10 +14083,8 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
13910
14083
  } else if (this.hasSerializeRecordsOption(attr)) {
13911
14084
  this._serializeEmbeddedHasMany(snapshot, json, relationship);
13912
14085
  } else {
13913
- if (true) {
13914
- if (this.hasSerializeIdsAndTypesOption(attr)) {
13915
- this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
13916
- }
14086
+ if (this.hasSerializeIdsAndTypesOption(attr)) {
14087
+ this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
13917
14088
  }
13918
14089
  }
13919
14090
  },
@@ -17287,7 +17458,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
17287
17458
  });
17288
17459
  });
17289
17460
  define("ember-data/version", ["exports"], function (exports) {
17290
- exports.default = "2.7.0";
17461
+ exports.default = "2.8.0-beta.1";
17291
17462
  });
17292
17463
  define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
17293
17464
 
@@ -17743,6 +17914,39 @@ define('ember-inflector/lib/utils/make-helper', ['exports', 'ember'], function (
17743
17914
  return _ember.default.Handlebars.makeBoundHelper(helperFunction);
17744
17915
  }
17745
17916
  });
17917
+ define('ember-load-initializers', ['exports', 'ember'], function (exports, _ember) {
17918
+ exports.default = function (app, prefix) {
17919
+ var regex = new RegExp('^' + prefix + '\/((?:instance-)?initializers)\/');
17920
+ var getKeys = Object.keys || _ember.default.keys;
17921
+
17922
+ getKeys(requirejs._eak_seen).map(function (moduleName) {
17923
+ return {
17924
+ moduleName: moduleName,
17925
+ matches: regex.exec(moduleName)
17926
+ };
17927
+ }).filter(function (dep) {
17928
+ return dep.matches && dep.matches.length === 2;
17929
+ }).forEach(function (dep) {
17930
+ var moduleName = dep.moduleName;
17931
+
17932
+ var module = require(moduleName, null, null, true);
17933
+ if (!module) {
17934
+ throw new Error(moduleName + ' must export an initializer.');
17935
+ }
17936
+
17937
+ var initializerType = _ember.default.String.camelize(dep.matches[1].substring(0, dep.matches[1].length - 1));
17938
+ var initializer = module['default'];
17939
+ if (!initializer.name) {
17940
+ var initializerName = moduleName.match(/[^\/]+\/?$/)[0];
17941
+ initializer.name = initializerName;
17942
+ }
17943
+
17944
+ if (app[initializerType]) {
17945
+ app[initializerType](initializer);
17946
+ }
17947
+ });
17948
+ };
17949
+ });
17746
17950
  define('ember', [], function() {
17747
17951
  return {
17748
17952
  default: Ember
@@ -17752,6 +17956,7 @@ define('ember', [], function() {
17752
17956
 
17753
17957
 
17754
17958
  require("ember-data");
17959
+ require("ember-load-initializers")["default"](Ember.Application, "ember-data");
17755
17960
  ;(function() {
17756
17961
  var global = require('ember-data/-private/global').default;
17757
17962
  var DS = require('ember-data').default;
@@ -17800,47 +18005,3 @@ require("ember-data");
17800
18005
  processEmberDataShims();
17801
18006
  }
17802
18007
  })();
17803
- /* eslint no-extra-semi: "off" */
17804
-
17805
- ;(function() {
17806
- /* globals Ember */
17807
- /* globals DS */
17808
- var K = Ember.K;
17809
- Ember.onLoad('Ember.Application', function(Application) {
17810
-
17811
- Application.initializer({
17812
- name: "ember-data",
17813
- initialize: DS._setupContainer
17814
- });
17815
-
17816
- Application.instanceInitializer({
17817
- name: "ember-data",
17818
- initialize: DS._initializeStoreService
17819
- });
17820
-
17821
- // Deprecated initializers to satisfy old code that depended on them
17822
- Application.initializer({
17823
- name: "store",
17824
- after: "ember-data",
17825
- initialize: K
17826
- });
17827
-
17828
- Application.initializer({
17829
- name: "transforms",
17830
- before: "store",
17831
- initialize: K
17832
- });
17833
-
17834
- Application.initializer({
17835
- name: "data-adapter",
17836
- before: "store",
17837
- initialize: K
17838
- });
17839
-
17840
- Application.initializer({
17841
- name: "injectStore",
17842
- before: "store",
17843
- initialize: K
17844
- });
17845
- });
17846
- })();