Story#105855968 - Shorter code on pricelist type calculation

This commit is contained in:
Vladimir Krylov 2016-02-10 14:31:48 +02:00
parent 89292bea53
commit e2cb9e99c4

View file

@ -549,13 +549,7 @@ class Domain < ActiveRecord::Base
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 ###