<commit_before>export default Ember.ObjectController.extend({
  controlTypeGroups: null,
  editingControl   : null,

  actions: {
    updateType: function () {

      // hax
      // firebase doesn't like undefined values and for some reason `_super` is
      // being added to arrays in ember with undefined value
      this.get('model.controls').forEach(function (control) {
        if (control.get('controlType.widget') === 'radio') {
          delete control.get('meta.data.options')._super;
        }
      });

      this.get('model').save().then(function () {
        window.ENV.sendGruntCommand('scaffolding:' + this.get('model.name'));
        this.transitionToRoute('wh.content');
      }.bind(this));
    },
    addControl: function (controlType) {
      var controls, control;

      controls = this.get('model.controls');

      control = this.store.createRecord('control', {
        label: controlType.get('name'),
        controlType: controlType,
        showInCms: (controls.get('length') < 3)
      });

      var meta = this.store.createRecord('meta-data');

      if (controlType.get('widget') === 'radio') {
        meta.set('data', {
          options: [
            { value: 'Option 1' },
            { value: 'Option 2' }
          ]
        });
      }

      control.set('meta', meta);

      controls.pushObject(control);
    },
    deleteControl: function (control) {
      this.get('model.controls').removeObject(control);
      control.destroyRecord();
      this.send('stopEditing');
    },
    editControl: function (control) {
      if (!control.get('meta')) {
        control.set('meta', this.store.createRecord('meta-data'));
      }
      this.set('editingControl', control);
    },
    stopEditing: function () {
      this.set('editingControl', null);
    },
    addOption: function (array) {
      array.pushObject({});
    },
    removeOption: function (array, option) {
      array.removeObject(option);
    },
    quitForm: function () {
      this.transitionToRoute('wh.content');
    }
  }
});
<commit_msg>change route<commit_after>export default Ember.ObjectController.extend({
  controlTypeGroups: null,
  editingControl   : null,

  actions: {
    updateType: function () {

      // hax
      // firebase doesn't like undefined values and for some reason `_super` is
      // being added to arrays in ember with undefined value
      this.get('model.controls').forEach(function (control) {
        if (control.get('controlType.widget') === 'radio') {
          delete control.get('meta.data.options')._super;
        }
      });

      this.get('model').save().then(function () {
        window.ENV.sendGruntCommand('scaffolding:' + this.get('model.name'));
        this.transitionToRoute('wh.content');
      }.bind(this));
    },
    addControl: function (controlType) {
      var controls, control;

      controls = this.get('model.controls');

      control = this.store.createRecord('control', {
        label: controlType.get('name'),
        controlType: controlType,
        showInCms: (controls.get('length') < 3)
      });

      var meta = this.store.createRecord('meta-data');

      if (controlType.get('widget') === 'radio') {
        meta.set('data', {
          options: [
            { value: 'Option 1' },
            { value: 'Option 2' }
          ]
        });
      }

      control.set('meta', meta);

      controls.pushObject(control);
    },
    deleteControl: function (control) {
      this.get('model.controls').removeObject(control);
      control.destroyRecord();
      this.send('stopEditing');
    },
    editControl: function (control) {
      if (!control.get('meta')) {
        control.set('meta', this.store.createRecord('meta-data'));
      }
      this.set('editingControl', control);
    },
    stopEditing: function () {
      this.set('editingControl', null);
    },
    addOption: function (array) {
      array.pushObject({});
    },
    removeOption: function (array, option) {
      array.removeObject(option);
    },
    quitForm: function () {
      this.transitionToRoute('wh.content.all-types');
    }
  }
});

{'fraction_non_alphanumeric': 0.15818934047213434, 'fraction_numerical': 0.0014602092966658554, 'mean_word_length': 2.4712837837837838, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3674604', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1173, 'n_words': 217}