Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix release] Remove some usages of enumerable utils that made it … #3411

Merged
merged 1 commit into from
Jun 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import normalizeModelName from "ember-data/system/normalize-model-name";
@module ember-data
*/

var forEach = Ember.EnumerableUtils.forEach;
var forEach = Ember.ArrayPolyfills.forEach;
var camelize = Ember.String.camelize;
var classify = Ember.String.classify;
var decamelize = Ember.String.decamelize;
Expand Down Expand Up @@ -280,7 +280,7 @@ var ActiveModelSerializer = RESTSerializer.extend({
payload.type = this.modelNameFromPayloadKey(payload.type);
} else if (payload && relationship.kind === "hasMany") {
var self = this;
forEach(payload, function(single) {
forEach.call(payload, function(single) {
single.type = self.modelNameFromPayloadKey(single.type);
});
}
Expand Down
10 changes: 5 additions & 5 deletions packages/ember-data/lib/serializers/json-api-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import normalizeModelName from 'ember-data/system/normalize-model-name';
import { pluralize, singularize } from 'ember-inflector/lib/system/string';

var dasherize = Ember.String.dasherize;
var map = Ember.EnumerableUtils.map;
var map = Ember.ArrayPolyfills.map;

/**
@class JSONAPISerializer
Expand Down Expand Up @@ -37,11 +37,11 @@ export default JSONSerializer.extend({
if (Ember.typeOf(documentHash.data) === 'object') {
documentHash.data = this._normalizeResourceHelper(documentHash.data);
} else {
documentHash.data = map(documentHash.data, this._normalizeResourceHelper, this);
documentHash.data = map.call(documentHash.data, this._normalizeResourceHelper, this);
}

if (Ember.typeOf(documentHash.included) === 'array') {
documentHash.included = map(documentHash.included, this._normalizeResourceHelper, this);
documentHash.included = map.call(documentHash.included, this._normalizeResourceHelper, this);
}

return documentHash;
Expand Down Expand Up @@ -133,7 +133,7 @@ export default JSONSerializer.extend({
}

if (Ember.typeOf(relationshipHash.data) === 'array') {
relationshipHash.data = map(relationshipHash.data, this._normalizeRelationshipDataHelper, this);
relationshipHash.data = map.call(relationshipHash.data, this._normalizeRelationshipDataHelper, this);
}

return relationshipHash;
Expand Down Expand Up @@ -327,7 +327,7 @@ export default JSONSerializer.extend({
payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');
}

let data = map(hasMany, (item) => {
let data = map.call(hasMany, (item) => {
return {
type: this.payloadKeyFromModelName(item.modelName),
id: item.id
Expand Down