mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Fix data migration #2732
This commit is contained in:
parent
6256d4abee
commit
7139a0c9ed
1 changed files with 4 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
||||||
class RefactorDomainStatuses < ActiveRecord::Migration
|
class RefactorDomainStatuses < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
Domain.all.each do |x|
|
Domain.find_each do |x|
|
||||||
x.statuses = []
|
statuses = []
|
||||||
x.domain_statuses.each do |ds|
|
x.domain_statuses.each do |ds|
|
||||||
x.statuses << ds.value
|
statuses << ds.value
|
||||||
end
|
end
|
||||||
x.save
|
x.update_column('statuses', statuses)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue