<commit_before>import Ember from 'ember';
import EmberValidations from 'ember-validations';

export default Ember.ObjectController.extend(EmberValidations.Mixin, {
  validations: {
    "model.def": {
      presence: true,
      length: { minimum: 10 }
    },
    "model.example": {
      presence: true,
      length: { minimum: 10 }
    }
  },
  actions: {
    submitProposal: function() {
      var _this = this;
      var proposal = this.get("model");
      proposal.set("type", "MeaningChange");

      proposal.save().then(function() {
        _this.get("parentController").set("editing", false);
        _this.set("meaning.hasProposal", true);
        _this.set("meaning.openProposal", _this.get("model"));
        _this.send("log", "proposal", "meaning change");
      },
      function(errors) {
        _this.set("errors", errors.errors);
      });
    },
    proposeMeaningRemoval: function() {
      console.log("REMOVES");
      // var _this = this;
      // var proposal = this.store.createRecord("proposal", {
      //                       type: "MeaningRemoval",
      //                       meaning: this.get("meaning")
      //                   });
      // this.get("model").destroy();
      // proposal.save().then(function() {
      //   _this.get("parentController").set("editing", false);
      //   _this.set("meaning.hasProposal", true);
      //   _this.set("meaning.openProposal", _this.get("model"));
      //   _this.send("log", "proposal", "meaning change");
      // }, function(errors) {
      //   _this.set("errors", errors.errors);
      // });

    }
  }
});<commit_msg>Function shouldn't just be console.log<commit_after>import Ember from 'ember';
import EmberValidations from 'ember-validations';

export default Ember.ObjectController.extend(EmberValidations.Mixin, {
  validations: {
    "model.def": {
      presence: true,
      length: { minimum: 10 }
    },
    "model.example": {
      presence: true,
      length: { minimum: 10 }
    }
  },
  actions: {
    submitProposal: function() {
      var _this = this;
      var proposal = this.get("model");
      proposal.set("type", "MeaningChange");

      proposal.save().then(function() {
        _this.get("parentController").set("editing", false);
        _this.set("meaning.hasProposal", true);
        _this.set("meaning.openProposal", _this.get("model"));
        _this.send("log", "proposal", "meaning change");
      },
      function(errors) {
        _this.set("errors", errors.errors);
      });
    },
    proposeMeaningRemoval: function() {
      var _this = this;
      var proposal = this.store.createRecord("proposal", {
                            type: "MeaningRemoval",
                            meaning: this.get("meaning")
                        });
      this.get("model").destroy();
      proposal.save().then(function() {
        _this.get("parentController").set("editing", false);
        _this.set("meaning.hasProposal", true);
        _this.set("meaning.openProposal", _this.get("model"));
        _this.send("log", "proposal", "meaning change");
      }, function(errors) {
        _this.set("errors", errors.errors);
      });

    }
  }
});
{'fraction_non_alphanumeric': 0.16903185115105646, 'fraction_numerical': 0.002522863450015768, 'mean_word_length': 2.3249475890985325, 'pattern_counts': {'":': 4, '<': 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': '7050503', 'n_tokens_mistral': 964, 'n_tokens_neox': 942, 'n_words': 157}