mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
parent
ed27152bb1
commit
4ddbb08e80
19 changed files with 111 additions and 271 deletions
|
@ -1,15 +1,14 @@
|
|||
class RefactorDomainStatuses < ActiveRecord::Migration
|
||||
class RefactorDomainStatuses < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
Domain.find_each do |x|
|
||||
statuses = []
|
||||
x.domain_statuses.each do |ds|
|
||||
statuses << ds.value
|
||||
end
|
||||
x.update_column('statuses', statuses)
|
||||
end
|
||||
# Domain.find_each do |x|
|
||||
# statuses = []
|
||||
# x.domain_statuses.each do |ds|
|
||||
# statuses << ds.value
|
||||
# end
|
||||
# x.update_column('statuses', statuses) if x.statuses.blank?
|
||||
# end
|
||||
end
|
||||
|
||||
def self.down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue