Revert "Debug migration"

This reverts commit 6d2bd0217d.
This commit is contained in:
Artur Beljajev 2017-04-28 13:59:39 +03:00
parent 6d2bd0217d
commit db884e82db

View file

@ -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