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 Model deprecations #3442

Merged
merged 1 commit into from
Jul 10, 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
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.