From ef87fb8a5dbc3d72fc10f7faaceefe1bdfe87e52 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 29 Jul 2024 16:59:17 -0400 Subject: [PATCH] Improve var names --- app/models/concerns/canonical_email.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/canonical_email.rb b/app/models/concerns/canonical_email.rb index 0a1d94ebb1d..7dae59e52f6 100644 --- a/app/models/concerns/canonical_email.rb +++ b/app/models/concerns/canonical_email.rb @@ -4,18 +4,18 @@ module CanonicalEmail extend ActiveSupport::Concern class_methods do - def email_to_canonical_email_hash(str) + def email_to_canonical_email_hash(value) Digest::SHA2 .new(256) .hexdigest( - email_to_canonical_email(str) + email_to_canonical_email(value) ) end private - def email_to_canonical_email(str) - username, domain = str.downcase.split('@', 2) + def email_to_canonical_email(value) + username, domain = value.downcase.split('@', 2) username, = username.delete('.').split('+', 2) "#{username}@#{domain}"