<commit_before>import Ember from 'ember';
import ModelUtils from 'ember-field-components/classes/model-utils';
import ModelTasksMixin from 'ember-mist-components/mixins/model-tasks';
import { task, taskGroup } from 'ember-concurrency';

export default Ember.Component.extend(ModelTasksMixin, {
  tagName: '',
  entityCache: Ember.inject.service(),
  store: Ember.inject.service(),

  modelType: Ember.computed('model', 'field', function(){
    return ModelUtils.getChildModelTypeName(this.get('model'), this.get('field'));
  }),
  parentField: Ember.computed('model', 'field', function(){
    return ModelUtils.getRelationshipInverse(this.get('model'), this.get('field'));
  }),
  filters: Ember.computed('model', 'parentField', function(){
    let filters = {};
    let parentField = this.get('parentField');

    filters[parentField] = this.get('model.id');
    return filters;
  }),
  newFromRelated: task(function * () {
    const modelType = this.get('modelType');
    const model = this.get('model');
    let cachedModel = this.get('store').createRecord(modelType);<commit_msg>Dasherize filter on related list<commit_after>import Ember from 'ember';
import ModelUtils from 'ember-field-components/classes/model-utils';
import ModelTasksMixin from 'ember-mist-components/mixins/model-tasks';
import { task, taskGroup } from 'ember-concurrency';

export default Ember.Component.extend(ModelTasksMixin, {
  tagName: '',
  entityCache: Ember.inject.service(),
  store: Ember.inject.service(),

  modelType: Ember.computed('model', 'field', function(){
    return ModelUtils.getChildModelTypeName(this.get('model'), this.get('field'));
  }),
  parentField: Ember.computed('model', 'field', function(){
    return ModelUtils.getRelationshipInverse(this.get('model'), this.get('field'));
  }),
  filters: Ember.computed('model', 'parentField', function(){
    let filters = {};
    let parentField = Ember.String.dasherize(this.get('parentField'));

    filters[parentField] = this.get('model.id');
    return filters;
  }),
  newFromRelated: task(function * () {
    const modelType = this.get('modelType');
    const model = this.get('model');
    let cachedModel = this.get('store').createRecord(modelType);
{'fraction_non_alphanumeric': 0.16206428248076052, 'fraction_numerical': 0.0, 'mean_word_length': 5.332378223495702, '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': '7585469', 'n_tokens_mistral': 665, 'n_tokens_neox': 657, 'n_words': 129}