<commit_before>$(document).ready ->
  new Vue
    el: '#createFare'
    mixins: [trainTypeSelector, companySelector]
    data:
      fares: [{km: 3.0, cost: 140}, {km: 6.0, cost: 190}]
      fareTable: ''
    methods:
      addFare: ->
        last = copyObject(@fares[@fares.length - 1])
        @fares.push(last)
      loadTSV: ->
        lines = @fareTable.split('\n').map (line) -> line.split('\t')
        @fares = lines.map (line) ->
          {km: parseFloat(line[0]), cost: parseInt(line[1])}
      submit: ->
        API.postJSON
          url: "/api/company/#{@company}/type/#{@trainType}/fares"
          fares = @fares.map (f) -> {km: parseFloat(f.km), cost: parseInt(f.cost)}
          data: {fares: fares}
          success: ->
            location.reload(false)<commit_msg>Fix create fares bug<commit_after>$(document).ready ->
  new Vue
    el: '#createFare'
    mixins: [trainTypeSelector, companySelector]
    data:
      fares: [{km: 3.0, cost: 140}, {km: 6.0, cost: 190}]
      fareTable: ''
    methods:
      addFare: ->
        last = copyObject(@fares[@fares.length - 1])
        @fares.push(last)
      loadTSV: ->
        lines = @fareTable.split('\n').map (line) -> line.split('\t')
        @fares = lines.map (line) ->
          {km: parseFloat(line[0]), cost: parseInt(line[1])}
      submit: ->
        fares = @fares.map (f) -> {km: parseFloat(f.km), cost: parseInt(f.cost)}
        API.postJSON
          url: "/api/company/#{@company}/type/#{@trainType}/fares"
          data: {fares: fares}
          success: ->
            location.reload(false)
{'fraction_non_alphanumeric': 0.1834282099936749, 'fraction_numerical': 0.01644528779253637, 'mean_word_length': 2.189516129032258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '1996006', 'n_tokens_mistral': 561, 'n_tokens_neox': 549, 'n_words': 108}