Debit account on domain create #2741

This commit is contained in:
Martin Lensment 2015-07-02 17:08:24 +03:00
parent e2374f9702
commit 98439b896c
7 changed files with 47 additions and 8 deletions

View file

@ -372,6 +372,12 @@ class Domain < ActiveRecord::Base
DomainMailer.pending_deleted(self).deliver_now
end
def price(operation)
zone = name.split('.').drop(1).join('.')
p = "#{self.period}year"
Pricelist.price_for(zone, operation, p)
end
### VALIDATIONS ###
def validate_nameserver_ips