mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Fix price checking for all the domains
This commit is contained in:
parent
7d2aad570e
commit
a954f3c8e6
5 changed files with 51 additions and 34 deletions
|
@ -9,18 +9,11 @@ module Domains
|
|||
string :unit
|
||||
|
||||
def execute
|
||||
if domain_pricelist.try(:price) # checking if price list is not found
|
||||
if current_user.registrar.balance < domain_pricelist.price.amount
|
||||
errors.add(:domain, I18n.t('billing_failure_credit_balance_low_for_domain',
|
||||
domain: domain.name))
|
||||
return false
|
||||
end
|
||||
else
|
||||
errors.add(:domain, I18n.t(:active_price_missing_for_operation_with_domain,
|
||||
domain: domain.name))
|
||||
return false
|
||||
end
|
||||
true
|
||||
return domain_pricelist.price.amount if domain_pricelist.try(:price)
|
||||
|
||||
errors.add(:domain, I18n.t(:active_price_missing_for_operation_with_domain,
|
||||
domain: domain.name))
|
||||
false
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue