mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Add period unit support to domain price method #2741
This commit is contained in:
parent
98439b896c
commit
61dfe6e1f3
2 changed files with 26 additions and 1 deletions
|
@ -374,7 +374,12 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
def price(operation)
|
||||
zone = name.split('.').drop(1).join('.')
|
||||
p = "#{self.period}year"
|
||||
|
||||
p = period / 365 if period_unit == 'd'
|
||||
p = period / 12 if period_unit == 'm'
|
||||
p = period if period_unit == 'y'
|
||||
|
||||
p = "#{p}year"
|
||||
Pricelist.price_for(zone, operation, p)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue