2020-10-24 08:47:20 -04:00
|
|
|
#!/usr/bin/env ruby
|
2024-02-25 12:15:55 -05:00
|
|
|
# frozen_string_literal: true
|
2020-10-24 08:47:20 -04:00
|
|
|
|
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
|
|
|
|
|
|
|
ModAction.find_each do |p|
|
|
|
|
begin
|
|
|
|
p.values = p.values_old
|
|
|
|
p.save!(validate: false)
|
|
|
|
rescue Encoding::UndefinedConversionError => e
|
|
|
|
# Interacting with the model at all throws the exception again. Yay rails.
|
|
|
|
rescue => e
|
|
|
|
puts "#{p.id} has an exception"
|
|
|
|
end
|
|
|
|
end
|