mirror of
https://github.com/internetee/registry.git
synced 2025-05-20 03:09:36 +02:00
parent
6d2bd0217d
commit
db884e82db
1 changed files with 1 additions and 7 deletions
|
@ -14,14 +14,8 @@ class AddZoneToPrices < ActiveRecord::Migration
|
||||||
private
|
private
|
||||||
|
|
||||||
def assign_zone_to_current_prices
|
def assign_zone_to_current_prices
|
||||||
p "Categories: #{Billing::Price.pluck(:category).uniq.sort}"
|
|
||||||
p "Zone origins: #{DNS::Zone.origins.sort}"
|
|
||||||
p 'Converting...'
|
|
||||||
|
|
||||||
Billing::Price.all.each do |price|
|
Billing::Price.all.each do |price|
|
||||||
p "Price: #{price.attributes}"
|
zone = DNS::Zone.find_by!(origin: price.category)
|
||||||
p "Price category: #{price.category}"
|
|
||||||
zone = DNS::Zone.find_by!(origin: price.category.strip)
|
|
||||||
price.zone = zone
|
price.zone = zone
|
||||||
price.save!
|
price.save!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue