Merge branch 'story/105855968-directo' into staging

# Conflicts:
#	Gemfile
#	Gemfile.lock
This commit is contained in:
Vladimir Krylov 2016-03-11 11:26:14 +02:00
commit 7d8cc9839f
15 changed files with 444 additions and 229 deletions

View file

@ -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 ###