mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Basic domain renew
This commit is contained in:
parent
d62106da20
commit
b828645920
7 changed files with 69 additions and 0 deletions
|
@ -124,6 +124,16 @@ class Domain < ActiveRecord::Base
|
|||
errors.add(:admin_contacts, :blank) if admin_contacts.empty?
|
||||
end
|
||||
|
||||
def renew(cur_exp_date, period, unit='y')
|
||||
if cur_exp_date == valid_to
|
||||
valid_to = period.to_i.years
|
||||
else
|
||||
errors[:base] << {msg: I18n.t('errors.messages.epp_exp_dates_do_not_match'), obj: 'domain', val: cur_exp_date}
|
||||
end
|
||||
|
||||
save
|
||||
end
|
||||
|
||||
class << self
|
||||
def check_availability(domains)
|
||||
domains = [domains] if domains.is_a?(String)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue