<commit_before>class PopulateUserFieldsFromUserAttributes < ActiveRecord::Migration
  def up
    say_with_time "Migrating User Attributes" do
      User.class_eval { serialize :user_attributes }
      User.all.each do |user|
        unless user.user_attributes.blank?
          user.update_attribute :aleph_id, user.user_attributes[:nyuidn]
          user.update_attribute :patron_status, user.user_attributes[:bor_status]
          user.update_attribute :institution_code, user.user_attributes[:primary_institution]
        end
      end
    end
  end

  def down
  end
end<commit_msg>Ignore error if no member in user_attributes struct, just use what you can use<commit_after>class PopulateUserFieldsFromUserAttributes < ActiveRecord::Migration
  def up
    say_with_time "Migrating User Attributes" do
      User.class_eval { serialize :user_attributes }
      User.all.each do |user|
        unless user.user_attributes.blank?
          user.update_attribute :aleph_id, user.user_attributes[:nyuidn] rescue ''
          user.update_attribute :patron_status, user.user_attributes[:bor_status] rescue ''
          user.update_attribute :institution_code, user.user_attributes[:primary_institution] rescue ''
        end
      end
    end
  end

  def down
  end
end
{'fraction_non_alphanumeric': 0.06866614048934491, 'fraction_numerical': 0.0, 'mean_word_length': 3.5611510791366907, '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': '140104', 'n_tokens_mistral': 363, 'n_tokens_neox': 362, 'n_words': 85}