Skip to content

Commit

Permalink
Merge pull request #5232 from emberjs/locks-patch-1
Browse files Browse the repository at this point in the history
Update documentation in model.js
  • Loading branch information
pangratz authored Oct 17, 2017
2 parents acb8d67 + 6168a10 commit 0bf0154
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions addon/-private/system/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,14 @@ const Model = EmberObject.extend(Evented, {
export default Route.extend({
actions: {
softDelete: function() {
this.controller.get('model').deleteRecord();
softDelete() {
this.get('controller.model').deleteRecord();
},
confirm: function() {
this.controller.get('model').save();
confirm() {
this.get('controller.model').save();
},
undo: function() {
this.controller.get('model').rollbackAttributes();
undo() {
this.get('controller.model').rollbackAttributes();
}
}
});
Expand All @@ -582,9 +582,8 @@ const Model = EmberObject.extend(Evented, {
export default Route.extend({
actions: {
delete: function() {
let controller = this.controller;
controller.get('model').destroyRecord().then(function() {
delete() {
this.get('controller.model').destroyRecord().then(function() {
controller.transitionToRoute('model.index');
});
}
Expand All @@ -603,7 +602,7 @@ const Model = EmberObject.extend(Evented, {
import MyCustomAdapter from './custom-adapter';
export default MyCustomAdapter.extend({
deleteRecord: function(store, type, snapshot) {
deleteRecord(store, type, snapshot) {
if (snapshot.adapterOptions.subscribe) {
// ...
}
Expand Down Expand Up @@ -771,7 +770,7 @@ const Model = EmberObject.extend(Evented, {
import MyCustomAdapter from './custom-adapter';
export default MyCustomAdapter.extend({
updateRecord: function(store, type, snapshot) {
updateRecord(store, type, snapshot) {
if (snapshot.adapterOptions.subscribe) {
// ...
}
Expand Down Expand Up @@ -803,7 +802,7 @@ const Model = EmberObject.extend(Evented, {
export default Route.extend({
actions: {
reload: function() {
reload() {
this.controller.get('model').reload().then(function(model) {
// do something with the reloaded model
});
Expand Down

0 comments on commit 0bf0154

Please sign in to comment.