Skip to content

Commit

Permalink
[CLEANUP beta] Remove Model deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
wecc committed Jun 24, 2015
1 parent b57ba30 commit 6c97348
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 106 deletions.
50 changes: 0 additions & 50 deletions packages/ember-data/lib/system/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,34 +101,6 @@ var Model = Ember.Object.extend(Ember.Evented, {
Example
```javascript
var record = store.createRecord('model');
record.get('isDirty'); // true
store.find('model', 1).then(function(model) {
model.get('isDirty'); // false
model.set('foo', 'some value');
model.get('isDirty'); // true
});
```
@property isDirty
@type {Boolean}
@readOnly
@deprecated
*/
isDirty: Ember.computed('currentState.isDirty', function() {
Ember.deprecate('DS.Model#isDirty has been deprecated please use hasDirtyAttributes instead');
return this.get('currentState.isDirty');
}),
/**
If this property is `true` the record is in the `dirty` state. The
record has local changes that have not yet been saved by the
adapter. This includes records that have been created (but not yet
saved) or deleted.
Example
```javascript
var record = store.createRecord('model');
record.get('hasDirtyAttributes'); // true
Expand Down Expand Up @@ -661,28 +633,6 @@ var Model = Ember.Object.extend(Ember.Evented, {
},
*/

/**
If the model `isDirty` this function will discard any unsaved
changes. If the model `isNew` it will be removed from the store.
Example
```javascript
record.get('name'); // 'Untitled Document'
record.set('name', 'Doc 1');
record.get('name'); // 'Doc 1'
record.rollback();
record.get('name'); // 'Untitled Document'
```
@method rollback
@deprecated Use `rollbackAttributes()` instead
*/
rollback: function() {
Ember.deprecate('Using model.rollback() has been deprecated. Use model.rollbackAttributes() to discard any unsaved changes to a model.');
this.rollbackAttributes();
},

/**
If the model `isDirty` this function will discard any unsaved
changes. If the model `isNew` it will be removed from the store.
Expand Down
20 changes: 0 additions & 20 deletions packages/ember-data/tests/unit/model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,23 +893,3 @@ test('accessing attributes in the initializer should not throw an error', functi

run(() => store.createRecord('person'));
});


test('isDirty should log a deprecation warning', function() {
expect(1);
var Person = DS.Model.extend({
name: DS.attr('string')
});

var env = setupStore({
person: Person
});
var store = env.store;

run(function() {
var person = store.createRecord('person');
expectDeprecation(function() {
person.get('isDirty');
}, /DS.Model#isDirty has been deprecated/);
});
});
36 changes: 0 additions & 36 deletions packages/ember-data/tests/unit/model/rollback-test.js

This file was deleted.

0 comments on commit 6c97348

Please sign in to comment.