mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 07:52:04 +02:00
Move statuses to domain #2623
This commit is contained in:
parent
0d0fd3407d
commit
50346c80c8
8 changed files with 78 additions and 45 deletions
15
db/data/20150612125720_refactor_domain_statuses.rb
Normal file
15
db/data/20150612125720_refactor_domain_statuses.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class RefactorDomainStatuses < ActiveRecord::Migration
|
||||
def self.up
|
||||
Domain.all.each do |x|
|
||||
x.statuses = []
|
||||
x.domain_statuses.each do |ds|
|
||||
x.statuses << ds.value
|
||||
end
|
||||
x.save
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue