Fix domain view

This commit is contained in:
Martin Lensment 2014-09-11 12:24:19 +03:00
parent 0cea91a28a
commit 2982b22921
3 changed files with 13 additions and 2 deletions

View file

@ -38,3 +38,4 @@ class Admin::DomainsController < ApplicationController
params.require(:domain).permit(:name, :period, :registrar_id, :owner_contact_id) params.require(:domain).permit(:name, :period, :registrar_id, :owner_contact_id)
end end
end end

View file

@ -103,6 +103,11 @@ class Domain < ActiveRecord::Base
errors.add(:period, :out_of_range) unless valid_values.include?(period.to_s) errors.add(:period, :out_of_range) unless valid_values.include?(period.to_s)
end end
def all_dependencies_valid?
validate_nameservers_count
validate_admin_contacts_count
end
## SHARED ## SHARED
def to_s def to_s

View file

@ -67,7 +67,7 @@ en:
blank: "Required parameter missing - ident" blank: "Required parameter missing - ident"
domains: domains:
exist: 'Object association prohibits operation' exist: 'Object association prohibits operation'
epp_domain: epp_domain: &epp_domain_ar_attributes
attributes: attributes:
name_dirty: name_dirty:
invalid: 'Domain name is invalid' invalid: 'Domain name is invalid'
@ -93,6 +93,8 @@ en:
domain_statuses: domain_statuses:
not_found: 'Status was not found' not_found: 'Status was not found'
taken: 'Status already exists on this domain' taken: 'Status already exists on this domain'
domain:
<<: *epp_domain_ar_attributes
nameserver: nameserver:
attributes: attributes:
hostname: hostname:
@ -110,12 +112,15 @@ en:
setting_id: setting_id:
taken: 'Status already exists on this domain' taken: 'Status already exists on this domain'
attributes: attributes:
epp_domain: epp_domain: &epp_domain_attributes
name: 'Domain name' name: 'Domain name'
name_dirty: 'Domain name' name_dirty: 'Domain name'
name_puny: 'Domain name' name_puny: 'Domain name'
owner_contact: 'Registrant' owner_contact: 'Registrant'
nameservers: 'Nameservers' nameservers: 'Nameservers'
domain:
<<: *epp_domain_attributes
errors: errors:
messages: messages: