From bcd1b3f745c68800d5abd729299a93d3a6a6db4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergei=20Ts=C3=B5ganov?= Date: Thu, 14 Apr 2022 14:28:26 +0300 Subject: [PATCH] Fixed codeclimate errors --- app/interactions/actions/contact_create.rb | 6 ++---- app/interactions/actions/contact_update.rb | 3 +-- app/interactions/actions/domain_update.rb | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/interactions/actions/contact_create.rb b/app/interactions/actions/contact_create.rb index f0d11896b0..f3e6560b8b 100644 --- a/app/interactions/actions/contact_create.rb +++ b/app/interactions/actions/contact_create.rb @@ -19,14 +19,12 @@ def call def maybe_change_email return if Rails.env.test? - [:regex, :mx].each do |m| + %i[regex mx].each do |m| result = Actions::SimpleMailValidator.run(email: contact.email, level: m) - next if result err_text = "email '#{contact.email}' didn't pass validation" - contact.add_epp_error('2005', nil, nil, - "#{I18n.t(:parameter_value_syntax_error)} #{err_text}") + contact.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}") @error = true return end diff --git a/app/interactions/actions/contact_update.rb b/app/interactions/actions/contact_update.rb index abf55e96a9..3442a56437 100644 --- a/app/interactions/actions/contact_update.rb +++ b/app/interactions/actions/contact_update.rb @@ -28,8 +28,7 @@ def maybe_change_email next if result err_text = "email '#{new_attributes[:email]}' didn't pass validation" - contact.add_epp_error('2005', nil, nil, - "#{I18n.t(:parameter_value_syntax_error)} #{err_text}") + contact.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}") @error = true return end diff --git a/app/interactions/actions/domain_update.rb b/app/interactions/actions/domain_update.rb index 7d556b2e8e..3c408e11f6 100644 --- a/app/interactions/actions/domain_update.rb +++ b/app/interactions/actions/domain_update.rb @@ -141,8 +141,7 @@ def validate_email(email) next if result err_text = "email #{email} didn't pass validation" - domain.add_epp_error('2005', nil, nil, - "#{I18n.t(:parameter_value_syntax_error)} #{err_text}") + domain.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}") @error = true return end