Story#105855968 - Shorter code on pricelist type calculation

This commit is contained in:
Vladimir Krylov 2016-02-10 14:31:48 +02:00
parent a218a0b5f2
commit e8bf3f7e64

View file

@ -458,13 +458,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 ###