demarches-normaliennes/app/tasks/maintenance/normalize_rna_values_task.rb

20 lines
378 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Maintenance
class NormalizeRNAValuesTask < MaintenanceTasks::Task
def collection
Champs::RNAChamp.where.not(value: nil)
end
def process(element)
if /\s/.match?(element.value)
element.update_column(:value, element.value.gsub(/\s+/, ''))
end
end
def count
# to costly
end
end
end