Merge branch 'registry-660' into registry-661

This commit is contained in:
Artur Beljajev 2018-01-31 15:04:28 +02:00
commit 9238348b8e
11 changed files with 12 additions and 13 deletions

View file

@ -4,9 +4,6 @@ env:
- DB=postgresql
bundler_args: --without development staging production
before_script:
- "psql -c 'create database registry_test;' -U postgres"
- "psql -c 'create database registry_whois_test;' -U postgres"
- "psql -c 'create database registry_api_log_test;' -U postgres"
- "cp config/application-example.yml config/application.yml"
- "cp config/database-travis.yml config/database.yml"
- "bundle exec rake db:setup:all"

View file

@ -35,9 +35,11 @@ module Repp
if errors.none?
status 204
body false
@response = {}
else
status 400
{ errors: errors }
@response = { errors: errors }
end
end
end

View file

@ -67,7 +67,7 @@ module Versions
map do |ver|
o = new(ver.object)
o.version_loader = ver
ver.object_changes.to_h.each { |k, v| o[k]=v[-1] }
ver.object_changes.to_h.each { |k, v| o.public_send("#{k}=", v[-1]) }
o
end
not_in_history = where(id: (ids.to_a - from_history.map(&:id)))

View file

@ -18,6 +18,7 @@ class Contact < ActiveRecord::Base
attr_accessor :legal_document_id
alias_attribute :kind, :ident_type
alias_attribute :copy_from_id, :original_id # Old attribute name; for PaperTrail
accepts_nested_attributes_for :legal_documents

View file

@ -16,6 +16,7 @@ class Domain < ActiveRecord::Base
alias_attribute :on_hold_time, :outzone_at
alias_attribute :outzone_time, :outzone_at
alias_attribute :auth_info, :transfer_code # Old attribute name; for PaperTrail
# TODO: whois requests ip whitelist for full info for own domains and partial info for other domains
# TODO: most inputs should be trimmed before validatation, probably some global logic?

View file

@ -58,7 +58,7 @@
- @versions.each do |version|
- if version
- contact = Contact.new(version.object.to_h)
- version.object_changes.to_h.each{|k,v| contact[k]=v.last}
- version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last) }
%tr
%td= link_to(contact.name, admin_contact_version_path(version.id))

View file

@ -1,5 +1,5 @@
- contact = Contact.new(@version.object.to_h)
- @version.object_changes.to_h.each{|k,v| contact[k]=v.last}
- @version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last ) }
= render 'shared/title', name: contact.name
.row

View file

@ -56,7 +56,7 @@
- @versions.each do |version|
- if version
- domain = Domain.new(version.object.to_h)
- version.object_changes.to_h.each{|k,v| domain[k]=v.last}
- version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
%tr
%td= link_to(domain.name, admin_domain_version_path(version.id))
@ -66,7 +66,7 @@
- else
- contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first
- if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o[k]=v.last } ))
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o.public_send("#{k}=", v.last) } ))
= contact.try(:name)
= "&#160;".html_safe
= "(#{t(:deleted)})"

View file

@ -1,5 +1,5 @@
- domain = Domain.new(@version.object.to_h)
- @version.object_changes.to_h.each{|k,v| domain[k]=v.last}
- @version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
- if @version
- children = HashWithIndifferentAccess.new(@version.children)

View file

@ -33,7 +33,7 @@
%td
%p.nowrap
= l(domain.updated_at, format: :shorts)
= l domain.updated_at
-#- if statuses_link
%br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id])

View file

@ -22,10 +22,8 @@ en:
longer: "%a, %e. %b %Y, %H:%M"
long: "%A, %e. %B %Y, %H:%M"
short: "%d.%m.%y, %H:%M"
shorts: "%d.%m.%y, %H:%M:%S"
date: "%Y-%m-%d"
date_long: "%d. %B %Y"
ydate: "%Y.%m.%d"
filename: "%Y-%m-%d_%H.%M"
date:
formats: