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

[CLEANUP beta] Remove ManyArray deprecations #3441

Merged
merged 1 commit into from
Jun 30, 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
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