1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2025-12-10 16:46:42 +01:00
projekteuler/db/migrate/20190202113250_add_status_to_translations.rb

16 lines
347 B
Ruby

class AddStatusToTranslations < ActiveRecord::Migration[5.2]
def change
add_column :translations, :status, :integer, default: 0
reversible do |dir|
dir.up do
Problem.all.each do |problem|
if problem.is_translated?
problem.translation.in_use!
end
end
end
end
end
end