mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
commit
9b9fb2f8aa
4 changed files with 4 additions and 12 deletions
|
@ -1,7 +1,6 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= zone.origin %></td>
|
<td><%= link_to zone.origin, edit_admin_zone_path(zone), id: 'admin-edit-zone-btn' %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to t('.edit_btn'), edit_admin_zone_path(zone), class: 'btn btn-xs btn-primary' %>
|
|
||||||
<%= link_to t('.generate_zone_file_btn'),
|
<%= link_to t('.generate_zone_file_btn'),
|
||||||
admin_zonefiles_path(origin: zone.origin),
|
admin_zonefiles_path(origin: zone.origin),
|
||||||
method: 'post', class: 'btn btn-xs btn-primary' %>
|
method: 'post', class: 'btn btn-xs btn-primary' %>
|
||||||
|
|
|
@ -29,5 +29,4 @@ en:
|
||||||
update_btn: Update zone
|
update_btn: Update zone
|
||||||
|
|
||||||
zone:
|
zone:
|
||||||
edit_btn: Edit
|
|
||||||
generate_zone_file_btn: Generate zone file
|
generate_zone_file_btn: Generate zone 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
|
||||||
|
|
|
@ -8,7 +8,7 @@ RSpec.feature 'Editing zone in admin area', settings: false do
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'updates zone' do
|
scenario 'updates zone' do
|
||||||
open_list
|
visit admin_zones_url
|
||||||
open_form
|
open_form
|
||||||
submit_form
|
submit_form
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ RSpec.feature 'Editing zone in admin area', settings: false do
|
||||||
end
|
end
|
||||||
|
|
||||||
def open_form
|
def open_form
|
||||||
click_link_or_button t('admin.dns.zones.zone.edit_btn')
|
click_link_or_button 'admin-edit-zone-btn'
|
||||||
end
|
end
|
||||||
|
|
||||||
def submit_form
|
def submit_form
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue