<commit_before>class FixBptFtaOwnershipText < ActiveRecord::DataMigration
  def up
    ftas = FtaOwnershipType.all
    ftas.each {|fta|
      if(fta.code == 'OOPE')
        fta.name = 'Owned outright by private entity'
        fta.code = 'OOPE'
        fta.description = 'Owned outright by private entity'
        fta.save
      end
      if(fta.code == 'OOPA')
        fta.name = 'Owned outright by public agency'
        fta.code = 'OOPA'
        fta.description = 'Owned outright by public agency'
        fta.save
      end

      if(fta.code == 'TLPE')
        fta.name = 'True lease by private entity'
        fta.code = 'TLPE'
        fta.description = 'True lease by private entity'
        fta.save
      end
      if(fta.code == 'TLPA')
        fta.name = 'True lease by public agency'
        fta.code = 'TLPA'
        fta.description = 'True lease by public agency'
        fta.save
      end

      if(fta.code == 'OTHR')
        fta.name = 'Other'
        fta.code = 'OTHR'
        fta.description = 'Other'
        fta.save
      end

      if(fta.code == 'LRPA')
        fta.name = 'Leased or borrowed from related parties by a public agency'
        fta.code = 'LRPA'
        fta.description = 'Leased or borrowed from related parties by a public agency'
        fta.save
      end


      if(fta.code == 'LRPE')
        fta.name = 'Leased or borrowed from related parties by a private entity'
        fta.code = 'LRPA'
        fta.description = 'Leased or borrowed from related parties by a private entity'
        fta.save
      end
<commit_msg>TTPLAT-336 Adds a migration to fix the BPT names which are wrong for the existing codes.<commit_after>class FixBptFtaOwnershipText < ActiveRecord::DataMigration
  def up
    ftas = FtaOwnershipType.all
    ftas.each {|fta|
      if(fta.code == 'OOPE')
        fta.name = 'Owned outright by private entity'
        fta.code = 'OOPE'
        fta.description = 'Owned outright by private entity'
        fta.save
      end
      if(fta.code == 'OOPA')
        fta.name = 'Owned outright by public agency'
        fta.code = 'OOPA'
        fta.description = 'Owned outright by public agency'
        fta.save
      end

      if(fta.code == 'TLPE')
        fta.name = 'True lease by private entity'
        fta.code = 'TLPE'
        fta.description = 'True lease by private entity'
        fta.save
      end
      if(fta.code == 'TLPA')
        fta.name = 'True lease by public agency'
        fta.code = 'TLPA'
        fta.description = 'True lease by public agency'
        fta.save
      end

      if(fta.code == 'OTHR')
        fta.name = 'Other'
        fta.code = 'OTHR'
        fta.description = 'Other'
        fta.save
      end

      if(fta.code == 'LRPA')
        fta.name = 'Leased or borrowed from related parties by a public agency'
        fta.code = 'LRPA'
        fta.description = 'Leased or borrowed from related parties by a public agency'
        fta.save
      end


      if(fta.code == 'LRPE')
        fta.name = 'Leased or borrowed from related parties by a private entity'
        fta.code = 'LRPE'
        fta.description = 'Leased or borrowed from related parties by a private entity'
        fta.save
      end

{'fraction_non_alphanumeric': 0.09553543552919139, 'fraction_numerical': 0.0009366219169528567, 'mean_word_length': 1.934065934065934, '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': '4043423', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1023, 'n_words': 309}