<commit_before>ETahi.PaperManageController = Ember.ObjectController.extend
  sortedPhases: ( ->
    Ember.ArrayProxy.createWithMixins(Em.SortableMixin, {
      content: @get('model.phases')
      sortProperties: ['position']
    })
  ).property('model.phases.@each')

  updatePositions: (phase)->
    relevantPhases = _(this.get('model.phases').content).filter((p)->
      p != phase && p.get('position') >= phase.get('position')
    )
    _(relevantPhases).each((p)->
      p.incrementProperty('position')
    )

  actions:<commit_msg>Use Ember enumerables in PaperManageControler#updatePositions<commit_after>ETahi.PaperManageController = Ember.ObjectController.extend
  sortedPhases: ( ->
    Ember.ArrayProxy.createWithMixins(Em.SortableMixin, {
      content: @get('model.phases')
      sortProperties: ['position']
    })
  ).property('model.phases.@each')

  updatePositions: (phase)->
    relevantPhases = this.get('model.phases').filter((p)->
      p != phase && p.get('position') >= phase.get('position')
    )

    relevantPhases.invoke('incrementProperty', 'position')

  actions:
{'fraction_non_alphanumeric': 0.163003663003663, 'fraction_numerical': 0.0, 'mean_word_length': 4.15566037735849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2497576', 'n_tokens_mistral': 351, 'n_tokens_neox': 342, 'n_words': 43}