<commit_before>namespace :database_updates do
  task :create_cards_for_old_parameter_channels, [:start_id] => :environment do |t, args|
    p args[:start_id]
    completed_kyc = UpholdConnection.where(is_member: true).where("id > ?", args[:start_id]).order(id: :asc)

    puts "Queueing up create cards for #{completed_kyc.size} users"
    completed_kyc.each do |connection|
      parameters = JSON.parse(connection.uphold_access_parameters)
      next if parameters["scope"].include?("cards:write")
      parameters["scope"].concat(" cards:write")
      connection.update(uphold_access_parameters: parameters.to_json)
      connection.publisher.channels.each do |channel|
        CreateUpholdChannelCardJob.perform_later(uphold_connection_id: connection.id, channel_id: channel.id)
      end
      puts "Changed for connection_id: connection.id"
    end
    puts 'Done!'<commit_msg>Fix print statement (#2183)<commit_after>namespace :database_updates do
  task :create_cards_for_old_parameter_channels, [:start_id] => :environment do |t, args|
    p args[:start_id]
    completed_kyc = UpholdConnection.where(is_member: true).where("id > ?", args[:start_id]).order(id: :asc)

    puts "Queueing up create cards for #{completed_kyc.size} users"
    completed_kyc.each do |connection|
      parameters = JSON.parse(connection.uphold_access_parameters)
      next if parameters["scope"].include?("cards:write")
      parameters["scope"].concat(" cards:write")
      connection.update(uphold_access_parameters: parameters.to_json)
      connection.publisher.channels.each do |channel|
        CreateUpholdChannelCardJob.perform_later(uphold_connection_id: connection.id, channel_id: channel.id)
      end
      puts "Changed for connection_id: #{connection.id}"
    end
    puts 'Done!'
{'fraction_non_alphanumeric': 0.11441390914189568, 'fraction_numerical': 0.002243409983174425, 'mean_word_length': 4.792207792207792, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4442915', 'n_tokens_mistral': 541, 'n_tokens_neox': 536, 'n_words': 108}