Rename registrar's url attribute to website

#279
This commit is contained in:
Artur Beljajev 2017-02-21 16:15:26 +02:00
parent 01edbc5710
commit c14d15d7b7
15 changed files with 26 additions and 19 deletions

View file

@ -85,7 +85,7 @@ class WhoisRecord < ActiveRecord::Base
# update registar triggers when adding new attributes # update registar triggers when adding new attributes
h[:registrar] = domain.registrar.name h[:registrar] = domain.registrar.name
h[:registrar_url] = domain.registrar.url h[:registrar_website] = domain.registrar.website
h[:registrar_phone] = domain.registrar.phone h[:registrar_phone] = domain.registrar.phone
h[:registrar_address] = domain.registrar.address h[:registrar_address] = domain.registrar.address
h[:registrar_changed] = domain.registrar.updated_at.try(:to_s, :iso8601) h[:registrar_changed] = domain.registrar.updated_at.try(:to_s, :iso8601)

View file

@ -16,8 +16,8 @@ class RegistrarPresenter
registrar.phone registrar.phone
end end
def url def website
registrar.url registrar.website
end end
private private

View file

@ -40,7 +40,7 @@ changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- end -%> <%- end -%>
Registrar: Registrar:
name: <%= json['registrar'] %> name: <%= json['registrar'] %>
url: <%= json['registrar_url'] %> url: <%= json['registrar_website'] %>
phone: <%= json['registrar_phone'] %> phone: <%= json['registrar_phone'] %>
changed: <%= json['registrar_changed'].to_s.tr('T',' ').sub('+', ' +') %> changed: <%= json['registrar_changed'].to_s.tr('T',' ').sub('+', ' +') %>

View file

@ -2,5 +2,5 @@
<%= registrar.name %><br> <%= registrar.name %><br>
Email: <%= registrar.email %><br> Email: <%= registrar.email %><br>
Phone: <%= registrar.phone %><br> Phone: <%= registrar.phone %><br>
Website: <%= registrar.url %> Website: <%= registrar.website %>
</p> </p>

View file

@ -1,4 +1,4 @@
<%= registrar.name %> <%= registrar.name %>
Email: <%= registrar.email %> Email: <%= registrar.email %>
Phone: <%= registrar.phone %> Phone: <%= registrar.phone %>
Website: <%= registrar.url %> Website: <%= registrar.website %>

View file

@ -2,5 +2,5 @@
<%= registrar.name %><br> <%= registrar.name %><br>
Email: <%= registrar.email %><br> Email: <%= registrar.email %><br>
Telefon: <%= registrar.phone %><br> Telefon: <%= registrar.phone %><br>
Veebileht: <%= registrar.url %> Veebileht: <%= registrar.website %>
</p> </p>

View file

@ -1,4 +1,4 @@
<%= registrar.name %> <%= registrar.name %>
Email: <%= registrar.email %> Email: <%= registrar.email %>
Telefon: <%= registrar.phone %> Telefon: <%= registrar.phone %>
Veebileht: <%= registrar.url %> Veebileht: <%= registrar.website %>

View file

@ -2,5 +2,5 @@
<%= registrar.name %><br> <%= registrar.name %><br>
Электронная почта: <%= registrar.email %><br> Электронная почта: <%= registrar.email %><br>
Телефон: <%= registrar.phone %><br> Телефон: <%= registrar.phone %><br>
Веб-сайт: <%= registrar.url %> Веб-сайт: <%= registrar.website %>
</p> </p>

View file

@ -1,4 +1,4 @@
<%= registrar.name %> <%= registrar.name %>
Электронная почта: <%= registrar.email %> Электронная почта: <%= registrar.email %>
Телефон: <%= registrar.phone %> Телефон: <%= registrar.phone %>
Веб-сайт: <%= registrar.url %> Веб-сайт: <%= registrar.website %>

View file

@ -0,0 +1,5 @@
class RenameRegistrarUrlToWebsite < ActiveRecord::Migration
def change
rename_column :registrars, :url, :website
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161227193500) do ActiveRecord::Schema.define(version: 20170221115548) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -1046,7 +1046,7 @@ ActiveRecord::Schema.define(version: 20161227193500) do
t.string "street" t.string "street"
t.string "zip" t.string "zip"
t.string "code" t.string "code"
t.string "url" t.string "website"
t.string "directo_handle" t.string "directo_handle"
t.boolean "vat" t.boolean "vat"
t.integer "legacy_id" t.integer "legacy_id"

View file

@ -2704,7 +2704,7 @@ CREATE TABLE registrars (
street character varying, street character varying,
zip character varying, zip character varying,
code character varying, code character varying,
url character varying, website character varying,
directo_handle character varying, directo_handle character varying,
vat boolean, vat boolean,
legacy_id integer, legacy_id integer,
@ -5278,3 +5278,5 @@ INSERT INTO schema_migrations (version) VALUES ('20161004101419');
INSERT INTO schema_migrations (version) VALUES ('20161227193500'); INSERT INTO schema_migrations (version) VALUES ('20161227193500');
INSERT INTO schema_migrations (version) VALUES ('20170221115548');

View file

@ -49,7 +49,7 @@ Fabricator(:eis, from: :registrar) do
city 'Tallinn' city 'Tallinn'
street 'Paldiski mnt 80' street 'Paldiski mnt 80'
zip '10617' zip '10617'
url 'www.internet.ee' website 'www.internet.ee'
code { sequence(:code) { |i| "EIS#{i}" } } code { sequence(:code) { |i| "EIS#{i}" } }
accounts(count: 1) { Fabricate(:account, account_activities: []) } accounts(count: 1) { Fabricate(:account, account_activities: []) }
end end

View file

@ -25,10 +25,10 @@ RSpec.describe RegistrarPresenter do
end end
end end
describe '#url' do describe '#website' do
it 'returns url' do it 'returns website' do
expect(registrar).to receive(:url).and_return('test url') expect(registrar).to receive(:website).and_return('test')
expect(presenter.url).to eq('test url') expect(presenter.website).to eq('test')
end end
end end
end end

View file

@ -11,7 +11,7 @@ RSpec.shared_examples 'domain mailer registrar info' do
name name
email email
phone phone
url website
) )
attributes.each do |attr_name| attributes.each do |attr_name|