fixed ArgumentError

This commit is contained in:
dinsmol 2021-09-03 16:12:16 +03:00
parent c771902780
commit 62d1ba45a2
8 changed files with 10 additions and 12 deletions

View file

@ -74,7 +74,7 @@ module Repp
render_epp_error
end
def render_epp_error(status = :bad_request, data = {})
def render_epp_error(status = :bad_request, **data)
@epp_errors ||= ActiveModel::Errors.new(self)
@epp_errors.add(:epp_errors, msg: 'Command failed', code: '2304') if data != {}

View file

@ -43,7 +43,7 @@ module Repp
return
end
render_success(create_update_success_body)
render_success(**create_update_success_body)
end
api :PUT, '/repp/v1/contacts/:contact_code'

View file

@ -11,9 +11,7 @@ module Domains
renewed_expire_time = prepare_renewed_expire_time
in_transaction_with_retries do
check_balance
success = domain.renew(renewed_expire_time: renewed_expire_time,
period: period,
unit: unit)
success = domain.renew(renewed_expire_time, period, unit)
if success
check_balance
reduce_balance

View file

@ -8,13 +8,13 @@ class DomainExpireEmailJob < ApplicationJob
attrs = {
domain: domain,
registrar: domain.registrar,
email: email,
email: email
}
if domain.force_delete_scheduled?
DomainExpireMailer.expired_soft(attrs).deliver_now
DomainExpireMailer.expired_soft(**attrs).deliver_now
else
DomainExpireMailer.expired(attrs).deliver_now
DomainExpireMailer.expired(**attrs).deliver_now
end
end
end

View file

@ -173,7 +173,7 @@ class Epp::Domain < Domain
### RENEW ###
def renew(renewed_expire_time:, period:, unit:)
def renew(renewed_expire_time, period, unit)
@is_renewal = true
add_renew_epp_errors unless renewable?

View file

@ -7,6 +7,6 @@ class DomainNameserverValidator < ActiveModel::EachValidator
return if values.size.between?(min, max)
association = options[:association] || attribute
record.errors.add(association, :out_of_range, { min: min, max: max })
record.errors.add(association, :out_of_range, **{ min: min, max: max })
end
end

View file

@ -5,6 +5,6 @@ class ObjectCountValidator < ActiveModel::EachValidator
return if values.size.between?(min, max)
association = options[:association] || attribute
record.errors.add(association, :out_of_range, { min: min, max: max })
record.errors.add(association, :out_of_range, **{ min: min, max: max })
end
end

View file

@ -6,7 +6,7 @@ module I18n
def localize(object, options = {})
options.merge!({ default: '-' })
object.present? ? original_localize(object, options) : ''
object.present? ? original_localize(object, **options) : ''
end
end
end