mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 18:48:49 +01:00
Add ability to accept or decline translations
This commit is contained in:
15
db/migrate/20190202113250_add_status_to_translations.rb
Normal file
15
db/migrate/20190202113250_add_status_to_translations.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user