From 3b940bfe2fd4bb0b6bd0b54f36a67f04aa06d4a4 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Fri, 30 Aug 2024 14:32:23 +0200 Subject: [PATCH] refacto --- .../decidim/friendly_signup/registration_form_override.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb b/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb index d1bb888..202cc16 100644 --- a/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb +++ b/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Decidim module FriendlySignup class RegistrationFormOverride < Decidim::RegistrationForm @@ -6,9 +8,7 @@ class RegistrationFormOverride < Decidim::RegistrationForm private def no_special_characters_in_email - if email =~ /[<>'"]/ - errors.add(:email, "contains invalid characters") - end + errors.add(:email, "contains invalid characters") if email =~ /[<>'"]/ end end end