Skip to content

Commit

Permalink
Merge pull request #3441 from wecc/cleanup-ManyArray
Browse files Browse the repository at this point in the history
[CLEANUP beta] Remove ManyArray deprecations
  • Loading branch information
bmac committed Jun 30, 2015
2 parents cdaa644 + 2b62d36 commit 6d7ffb0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
20 changes: 0 additions & 20 deletions packages/ember-data/lib/system/many-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,25 +277,5 @@ export default Ember.Object.extend(Ember.MutableArray, Ember.Evented, {
this.pushObject(record);

return record;
},

/**
@method addRecord
@param {DS.Model} record
@deprecated Use `addObject()` instead
*/
addRecord: function(record) {
Ember.deprecate('Using manyArray.addRecord() has been deprecated. You should use manyArray.addObject() instead.');
this.addObject(record);
},

/**
@method removeRecord
@param {DS.Model} record
@deprecated Use `removeObject()` instead
*/
removeRecord: function(record) {
Ember.deprecate('Using manyArray.removeRecord() has been deprecated. You should use manyArray.removeObject() instead.');
this.removeObject(record);
}
});
32 changes: 0 additions & 32 deletions packages/ember-data/tests/unit/many-array-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,6 @@ test("manyArray.save() calls save() on all records", function() {
});
});

test("manyArray.addRecord() has been deprecated", function() {
expect(3);

run(function() {
var tag = store.push('tag', { id: 1, name: 'Ember.js' });
var post = store.push('post', { id: 2, title: 'A framework for creating ambitious web applications' });
var tags = post.get('tags');

equal(tags.length, 0, 'there should not be any tags');
expectDeprecation(function() {
tags.addRecord(tag);
});
equal(tags.length, 1, 'there should be 1 tag');
});
});

test("manyArray.removeRecord() has been deprecated", function() {
expect(3);
run(function() {
var tag = store.push('tag', { id: 1, name: 'Ember.js' });
var post = store.push('post', { id: 2, title: 'A framework for creating ambitious web applications', tags: [1] });
var tags = post.get('tags');

equal(tags.length, 1, 'there should be 1 tag');
expectDeprecation(function() {
tags.removeRecord(tag);
});
equal(tags.length, 0, 'there should not be any tags');
});
});


test("manyArray trigger arrayContentChange functions with the correct values", function() {
expect(12);
var willChangeStartIdx;
Expand Down

0 comments on commit 6d7ffb0

Please sign in to comment.