mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
Move expiration logic from domain's callback to epp::domain.new_from_epp
#186
This commit is contained in:
parent
ad0220088a
commit
0de7512adc
4 changed files with 37 additions and 15 deletions
|
@ -77,7 +77,6 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
before_create :generate_auth_info
|
||||
before_create :set_validity_dates
|
||||
before_create -> { self.reserved = in_reserved_list?; nil }
|
||||
|
||||
before_save :manage_automatic_statuses
|
||||
|
@ -546,13 +545,6 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
# rubocop:enable Lint/Loop
|
||||
|
||||
def set_validity_dates
|
||||
self.registered_at = Time.zone.now
|
||||
self.valid_from = Time.zone.now
|
||||
# we need + 1 day as this is more correct from juridical side
|
||||
self.valid_to = valid_from.utc.beginning_of_day + self.class.convert_period_to_time(period, period_unit) + 1.day
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def set_force_delete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue