<commit_before>import {singularize} from 'ember-inflector/lib/system/string';
import normalizeModelName from 'ember-data/system/normalize-model-name';

export function typeForRelationshipMeta(meta) {
  var modelName;

  modelName = meta.type || meta.key;
  return singularize(normalizeModelName(modelName));
}

export function relationshipFromMeta(meta) {
  return {
    key:  meta.key,
    kind: meta.kind,
    type: typeForRelationshipMeta(meta),
    options:    meta.options,
    parentType: meta.parentType,
    isRelationship: true
  };
}<commit_msg>avoid unnecessary singularization for belongsTo relationships<commit_after>import {singularize} from 'ember-inflector/lib/system/string';
import normalizeModelName from 'ember-data/system/normalize-model-name';

export function typeForRelationshipMeta(meta) {
  var modelName;

  modelName = meta.type || meta.key;
  if (meta.kind === 'hasMany') {
    modelName = singularize(normalizeModelName(modelName));
  }
  return modelName;
}

export function relationshipFromMeta(meta) {
  return {
    key:  meta.key,
    kind: meta.kind,
    type: typeForRelationshipMeta(meta),
    options:    meta.options,
    parentType: meta.parentType,
    isRelationship: true
  };
}
{'fraction_non_alphanumeric': 0.10801963993453355, 'fraction_numerical': 0.0, 'mean_word_length': 4.610091743119266, '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': '7315203', 'n_tokens_mistral': 377, 'n_tokens_neox': 370, 'n_words': 78}