Add logging to white ip

This commit is contained in:
Martin Lensment 2015-05-19 17:25:47 +03:00
parent 8e37355e13
commit 76ea1389e6
7 changed files with 73 additions and 27 deletions

View file

@ -0,0 +1,5 @@
class WhiteIpVersion < PaperTrail::Version
include VersionSession
self.table_name = :log_white_ips
self.sequence_name = :log_white_ips_id_seq
end

View file

@ -1,4 +1,5 @@
class WhiteIp < ActiveRecord::Base
include Versions
belongs_to :registrar
# rubocop: disable Metrics/LineLength
@ -12,5 +13,9 @@ class WhiteIp < ActiveRecord::Base
errors.add(:base, I18n.t(:ipv4_or_ipv6_must_be_present))
end
INTERFACES = ['epp', 'repp', 'registrar']
INTERFACE_EPP = 'epp'
INTERFACE_REPP = 'repp'
INTERFACE_REGISTRAR = 'registrar'
INTERFACES = [INTERFACE_EPP, INTERFACE_REPP, INTERFACE_REGISTRAR]
end

View file

@ -13,12 +13,12 @@
.col-md-4.control-label
= f.label :ipv4
.col-md-7
= f.text_field(:ipv4, class: 'form-control')
= f.text_field(:ipv4, class: 'form-control', ipv4: true)
.form-group
.col-md-4.control-label
= f.label :ipv6
.col-md-7
= f.text_field(:ipv6, class: 'form-control')
= f.text_field(:ipv6, class: 'form-control', ipv6: true)
.form-group
.col-md-4.control-label
= f.label :interface