dist/globals/ember-data.prod.js in ember-data-source-2.9.0.beta.4 vs dist/globals/ember-data.prod.js in ember-data-source-2.9.0
- old
+ new
@@ -4,11 +4,11 @@
/*!
* @overview Ember Data
* @copyright Copyright 2011-2016 Tilde Inc. and contributors.
* Portions Copyright 2011 LivingSocial Inc.
* @license Licensed under MIT license (see license.js)
- * @version 2.9.0-beta.4
+ * @version 2.9.0
*/
var loader, define, requireModule, require, requirejs;
(function(global) {
@@ -2902,11 +2902,11 @@
return reference;
}
};
- if ((0, _emberDataPrivateFeatures.default)('ds-reset-attribute')) {
+ if (false) {
/*
Returns the latest truth for an attribute - the canonical value, or the
in-flight value.
@method lastAcknowledgedValue
@private
@@ -3812,11 +3812,11 @@
return this.store.container;
}
});
}
- if ((0, _emberDataPrivateFeatures.default)('ds-reset-attribute')) {
+ if (false) {
Model.reopen({
/**
Discards any unsaved changes to the given attribute.
Example
```javascript
@@ -5547,11 +5547,11 @@
return _ember.default.RSVP.resolve(objectOrPromise).then(function (data) {
var record;
if (data instanceof _emberDataModel.default) {
- if ((0, _emberDataPrivateFeatures.default)('ds-overhaul-references')) {}
+ if (false) {}
record = data;
} else {
record = _this.store.push(data);
}
@@ -5641,21 +5641,21 @@
var _this = this;
return _ember.default.RSVP.resolve(objectOrPromise).then(function (payload) {
var array = payload;
- if ((0, _emberDataPrivateFeatures.default)("ds-overhaul-references")) {}
+ if (false) {}
var useLegacyArrayPush = true;
if (typeof payload === "object" && payload.data) {
array = payload.data;
useLegacyArrayPush = array.length && array[0].data;
- if ((0, _emberDataPrivateFeatures.default)('ds-overhaul-references')) {}
+ if (false) {}
}
- if (!(0, _emberDataPrivateFeatures.default)('ds-overhaul-references')) {
+ if (!false) {
useLegacyArrayPush = true;
}
var internalModels = undefined;
if (useLegacyArrayPush) {
@@ -9601,11 +9601,11 @@
} else {
payload = inputPayload;
serializer = this.serializerFor(modelName);
}
- if ((0, _emberDataPrivateFeatures.default)('ds-pushpayload-return')) {
+ if (false) {
return this._adapterRun(function () {
return serializer.pushPayload(_this3, payload);
});
} else {
this._adapterRun(function () {
@@ -11245,11 +11245,11 @@
detail: message
}];
}
var extendedErrorsEnabled = false;
- if ((0, _emberDataPrivateFeatures.default)('ds-extended-errors')) {
+ if (false) {
extendedErrorsEnabled = true;
}
function extendFn(ErrorClass) {
return function () {
@@ -11535,11 +11535,11 @@
@param {Array} ids
@param {Array} snapshots
@return {Promise} promise
*/
findMany: function (store, type, ids, snapshots) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
return this._super.apply(this, arguments);
} else {
var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
return this.ajax(url, 'GET', { data: { filter: { id: ids.join(',') } } });
}
@@ -11562,11 +11562,11 @@
@param {DS.Model} type
@param {DS.Snapshot} snapshot
@return {Promise} promise
*/
updateRecord: function (store, type, snapshot) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
return this._super.apply(this, arguments);
} else {
var data = {};
var serializer = store.serializerFor(type.modelName);
@@ -11590,11 +11590,11 @@
return false;
}
});
- if (true) {
+ if (false) {
JSONAPIAdapter.reopen({
methodForRequest: function (params) {
if (params.requestType === 'updateRecord') {
@@ -12018,11 +12018,11 @@
@param {String} id
@param {DS.Snapshot} snapshot
@return {Promise} promise
*/
findRecord: function (store, type, id, snapshot) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, id: id, snapshot: snapshot,
requestType: 'findRecord'
});
@@ -12048,11 +12048,11 @@
@return {Promise} promise
*/
findAll: function (store, type, sinceToken, snapshotRecordArray) {
var query = this.buildQuery(snapshotRecordArray);
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, sinceToken: sinceToken, query: query,
snapshots: snapshotRecordArray,
requestType: 'findAll'
});
@@ -12082,11 +12082,11 @@
@param {DS.Model} type
@param {Object} query
@return {Promise} promise
*/
query: function (store, type, query) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, query: query,
requestType: 'query'
});
@@ -12116,11 +12116,11 @@
@param {DS.Model} type
@param {Object} query
@return {Promise} promise
*/
queryRecord: function (store, type, query) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, query: query,
requestType: 'queryRecord'
});
@@ -12161,11 +12161,11 @@
@param {Array} ids
@param {Array} snapshots
@return {Promise} promise
*/
findMany: function (store, type, ids, snapshots) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, ids: ids, snapshots: snapshots,
requestType: 'findMany'
});
@@ -12201,11 +12201,11 @@
@param {DS.Snapshot} snapshot
@param {String} url
@return {Promise} promise
*/
findHasMany: function (store, snapshot, url, relationship) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, snapshot: snapshot, url: url, relationship: relationship,
requestType: 'findHasMany'
});
@@ -12245,11 +12245,11 @@
@param {DS.Snapshot} snapshot
@param {String} url
@return {Promise} promise
*/
findBelongsTo: function (store, snapshot, url, relationship) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, snapshot: snapshot, url: url, relationship: relationship,
requestType: 'findBelongsTo'
});
@@ -12275,11 +12275,11 @@
@param {DS.Model} type
@param {DS.Snapshot} snapshot
@return {Promise} promise
*/
createRecord: function (store, type, snapshot) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, snapshot: snapshot,
requestType: 'createRecord'
});
@@ -12307,11 +12307,11 @@
@param {DS.Model} type
@param {DS.Snapshot} snapshot
@return {Promise} promise
*/
updateRecord: function (store, type, snapshot) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, snapshot: snapshot,
requestType: 'updateRecord'
});
@@ -12337,11 +12337,11 @@
@param {DS.Model} type
@param {DS.Snapshot} snapshot
@return {Promise} promise
*/
deleteRecord: function (store, type, snapshot) {
- if (true && !this._hasCustomizedAjax()) {
+ if (false && !this._hasCustomizedAjax()) {
var request = this._requestFor({
store: store, type: type, snapshot: snapshot,
requestType: 'deleteRecord'
});
@@ -12473,11 +12473,11 @@
}
var errors = this.normalizeErrorResponse(status, headers, payload);
var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);
- if ((0, _emberDataPrivateFeatures.default)('ds-extended-errors')) {
+ if (false) {
switch (status) {
case 401:
return new _emberDataAdaptersErrors.UnauthorizedError(errors, detailedMessage);
case 403:
return new _emberDataAdaptersErrors.ForbiddenError(errors, detailedMessage);
@@ -12704,11 +12704,11 @@
return false;
}
});
- if (true) {
+ if (false) {
RESTAdapter.reopen({
/**
* Get the data (body or query params) for a request.
@@ -13191,11 +13191,11 @@
_emberDataPrivateCore.default.AdapterError = _emberDataAdaptersErrors.AdapterError;
_emberDataPrivateCore.default.InvalidError = _emberDataAdaptersErrors.InvalidError;
_emberDataPrivateCore.default.TimeoutError = _emberDataAdaptersErrors.TimeoutError;
_emberDataPrivateCore.default.AbortError = _emberDataAdaptersErrors.AbortError;
- if ((0, _emberDataPrivateFeatures.default)('ds-extended-errors')) {
+ if (false) {
_emberDataPrivateCore.default.UnauthorizedError = _emberDataAdaptersErrors.UnauthorizedError;
_emberDataPrivateCore.default.ForbiddenError = _emberDataAdaptersErrors.ForbiddenError;
_emberDataPrivateCore.default.NotFoundError = _emberDataAdaptersErrors.NotFoundError;
_emberDataPrivateCore.default.ConflictError = _emberDataAdaptersErrors.ConflictError;
_emberDataPrivateCore.default.ServerError = _emberDataAdaptersErrors.ServerError;
@@ -14169,11 +14169,11 @@
@param {Object} relationshipDataHash
@return {Object}
@private
*/
_normalizeRelationshipDataHelper: function (relationshipDataHash) {
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
var modelName = this.modelNameFromPayloadType(relationshipDataHash.type);
var deprecatedModelNameLookup = this.modelNameFromPayloadKey(relationshipDataHash.type);
if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
@@ -14198,11 +14198,11 @@
_normalizeResourceHelper: function (resourceHash) {
var modelName = undefined,
usedLookup = undefined;
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
modelName = this.modelNameFromPayloadType(resourceHash.type);
var deprecatedModelNameLookup = this.modelNameFromPayloadKey(resourceHash.type);
usedLookup = 'modelNameFromPayloadType';
@@ -14235,11 +14235,11 @@
@param {DS.Store} store
@param {Object} payload
*/
pushPayload: function (store, payload) {
var normalizedPayload = this._normalizeDocumentHelper(payload);
- if ((0, _emberDataPrivateFeatures.default)('ds-pushpayload-return')) {
+ if (false) {
return store.push(normalizedPayload);
} else {
store.push(normalizedPayload);
}
},
@@ -14345,11 +14345,11 @@
@param {Object} resourceHash
@return {String}
@private
*/
_extractType: function (modelClass, resourceHash) {
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
var modelName = this.modelNameFromPayloadType(resourceHash.type);
var deprecatedModelNameLookup = this.modelNameFromPayloadKey(resourceHash.type);
if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
@@ -14468,11 +14468,11 @@
*/
serialize: function (snapshot, options) {
var data = this._super.apply(this, arguments);
var payloadType = undefined;
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
payloadType = this.payloadTypeFromModelName(snapshot.modelName);
var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(snapshot.modelName);
if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
@@ -14537,11 +14537,11 @@
var data = null;
if (belongsTo) {
var payloadType = undefined;
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
payloadType = this.payloadTypeFromModelName(belongsTo.modelName);
var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(belongsTo.modelName);
if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
@@ -14569,11 +14569,11 @@
@param {Object} relationship
*/
serializeHasMany: function (snapshot, json, relationship) {
var key = relationship.key;
var shouldSerializeHasMany = '_shouldSerializeHasMany';
- if ((0, _emberDataPrivateFeatures.default)("ds-check-should-serialize-relationships")) {
+ if (false) {
shouldSerializeHasMany = 'shouldSerializeHasMany';
}
if (this[shouldSerializeHasMany](snapshot, key, relationship)) {
var hasMany = snapshot.hasMany(key);
@@ -14591,11 +14591,11 @@
for (var i = 0; i < hasMany.length; i++) {
var item = hasMany[i];
var payloadType = undefined;
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
payloadType = this.payloadTypeFromModelName(item.modelName);
var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(item.modelName);
if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
@@ -14615,11 +14615,11 @@
}
}
}
});
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
JSONAPISerializer.reopen({
/**
`modelNameFromPayloadType` can be used to change the mapping for a DS model
@@ -14634,11 +14634,11 @@
"type: "api::v1::post"
}
}
```
By overwriting `modelNameFromPayloadType` you can specify that the
- `posr` model should be used:
+ `post` model should be used:
```app/serializers/application.js
import DS from "ember-data";
export default DS.JSONAPISerializer.extend({
modelNameFromPayloadType(payloadType) {
return payloadType.replace('api::v1::', '');
@@ -15295,11 +15295,11 @@
}
var modelClass = this.store.modelFor(relationshipModelName);
if (relationshipHash.type && !(0, _emberDataPrivateUtils.modelHasAttributeOrRelationshipNamedType)(modelClass)) {
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
var modelName = this.modelNameFromPayloadType(relationshipHash.type);
var deprecatedModelNameLookup = this.modelNameFromPayloadKey(relationshipHash.type);
if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
@@ -15853,11 +15853,11 @@
@param {Object} relationship
*/
serializeHasMany: function (snapshot, json, relationship) {
var key = relationship.key;
var shouldSerializeHasMany = '_shouldSerializeHasMany';
- if ((0, _emberDataPrivateFeatures.default)("ds-check-should-serialize-relationships")) {
+ if (false) {
shouldSerializeHasMany = 'shouldSerializeHasMany';
}
if (this[shouldSerializeHasMany](snapshot, key, relationship)) {
var hasMany = snapshot.hasMany(key, { ids: true });
@@ -16104,11 +16104,11 @@
return transform;
}
});
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
JSONSerializer.reopen({
/**
@method modelNameFromPayloadType
@@ -16311,11 +16311,11 @@
var primaryHasTypeAttribute = (0, _emberDataPrivateUtils.modelHasAttributeOrRelationshipNamedType)(primaryModelClass);
if (!primaryHasTypeAttribute && hash.type) {
// Support polymorphic records in async relationships
var modelName = undefined;
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
modelName = this.modelNameFromPayloadType(hash.type);
var deprecatedModelNameLookup = this.modelNameFromPayloadKey(hash.type);
if (modelName !== deprecatedModelNameLookup && !this._hasCustomModelNameFromPayloadType() && this._hasCustomModelNameFromPayloadKey()) {
@@ -16527,11 +16527,11 @@
(_documentHash$included5 = documentHash.included).push.apply(_documentHash$included5, _toConsumableArray(included));
}
});
}
- if ((0, _emberDataPrivateFeatures.default)('ds-pushpayload-return')) {
+ if (false) {
return store.push(documentHash);
} else {
store.push(documentHash);
}
},
@@ -16802,11 +16802,11 @@
}
if (_ember.default.isNone(belongsTo)) {
json[typeKey] = null;
} else {
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
json[typeKey] = this.payloadTypeFromModelName(belongsTo.modelName);
} else {
json[typeKey] = camelize(belongsTo.modelName);
}
}
@@ -16846,11 +16846,11 @@
var isPolymorphic = relationshipMeta.options.polymorphic;
var typeProperty = this.keyForPolymorphicType(key, relationshipType, 'deserialize');
if (isPolymorphic && resourceHash[typeProperty] !== undefined && typeof relationshipHash !== 'object') {
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
var payloadType = resourceHash[typeProperty];
var type = this.modelNameFromPayloadType(payloadType);
var deprecatedTypeLookup = this.modelNameFromPayloadKey(payloadType);
@@ -16875,11 +16875,11 @@
return this._super.apply(this, arguments);
}
});
- if ((0, _emberDataPrivateFeatures.default)("ds-payload-type-hooks")) {
+ if (false) {
RESTSerializer.reopen({
/**
`modelNameFromPayloadType` can be used to change the mapping for a DS model
@@ -17101,10 +17101,10 @@
*/
deserialize: null
});
});
define("ember-data/version", ["exports"], function (exports) {
- exports.default = "2.9.0-beta.4";
+ exports.default = "2.9.0";
});
define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
_emberInflectorLibSystem.Inflector.defaultRules = _emberInflectorLibSystem.defaultRules;
_ember.default.Inflector = _emberInflectorLibSystem.Inflector;