<commit_before>import Ember from 'ember';

export default Ember.Mixin.create({
  resetController: function() {
    var model = this.get('controller.model');
    if(!model.get('isDeleted')) {
      model.rollback();
      if (model.get('isNew')) {
        model.deleteRecord();
      }
    }
  },
  actions: {
    willTransition: function(transition) {
      var model = this.get('controller.model');
      if (model.get('isDirty') && !this.willTransitionConfirm(transition)) {
        transition.abort();
      }
    }
  },
  willTransitionConfirm: function(transition) {
    /*jshint unused:false*/
    return true;
  }
});
<commit_msg>Don't rollback new record, just delete them - if new record is rolled back isNew will return false and record is never deleted<commit_after>import Ember from 'ember';

export default Ember.Mixin.create({
  resetController: function() {
    var model = this.get('controller.model');
    if(!model.get('isDeleted')) {
      if (model.get('isNew')) {
        model.deleteRecord();
      } else {
        model.rollback();
      }
    }
  },
  actions: {
    willTransition: function(transition) {
      var model = this.get('controller.model');
      if (model.get('isDirty') && !this.willTransitionConfirm(transition)) {
        transition.abort();
      }
    }
  },
  willTransitionConfirm: function(transition) {
    /*jshint unused:false*/
    return true;
  }
});

{'fraction_non_alphanumeric': 0.14743589743589744, 'fraction_numerical': 0.0, 'mean_word_length': 2.9801699716713883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6013635', 'n_tokens_mistral': 419, 'n_tokens_neox': 421, 'n_words': 88}