mirror of
https://github.com/internetee/registry.git
synced 2025-07-12 14:08:17 +02:00
Period validation
This commit is contained in:
parent
6990da7675
commit
1e2dad06f9
6 changed files with 16 additions and 1 deletions
|
@ -25,6 +25,7 @@ module Epp::DomainsHelper
|
|||
name: ph[:name],
|
||||
registrar_id: current_epp_user.registrar.try(:id),
|
||||
registered_at: Time.now,
|
||||
period: ph[:period].to_i,
|
||||
valid_from: Date.today,
|
||||
valid_to: Date.today + ph[:period].to_i.years,
|
||||
auth_info: ph[:authInfo][:pw]
|
||||
|
|
|
@ -10,6 +10,7 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
validates :name, domain_name: true, uniqueness: { message: I18n.t('errors.messages.epp_domain_taken') }
|
||||
validates :name_puny, domain_name: true
|
||||
validates :period, numericality: { only_integer: true, greater_than: 0, less_than: 100 }
|
||||
|
||||
def name=(value)
|
||||
value.strip!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue