mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Merge branch 'story/105855968-directo' into staging
# Conflicts: # Gemfile # Gemfile.lock
This commit is contained in:
commit
7d8cc9839f
15 changed files with 444 additions and 229 deletions
|
@ -456,19 +456,14 @@ class Domain < ActiveRecord::Base
|
|||
period_i ||= period
|
||||
unit ||= period_unit
|
||||
|
||||
# TODO: test if name.scan(/\.(.+)\z/).first.first is faster
|
||||
zone = name.split('.').drop(1).join('.')
|
||||
|
||||
p = period_i / 365 if unit == 'd'
|
||||
p = period_i / 12 if unit == 'm'
|
||||
p = period_i if unit == 'y'
|
||||
|
||||
if p > 1
|
||||
p = "#{p}years"
|
||||
else
|
||||
p = "#{p}year"
|
||||
end
|
||||
|
||||
Pricelist.pricelist_for(zone, operation, p)
|
||||
Pricelist.pricelist_for(zone, operation, "#{p}year".pluralize(p))
|
||||
end
|
||||
|
||||
### VALIDATIONS ###
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue