WHO HAS SPACES IN THEIR DATASET

This commit is contained in:
24c02 2025-01-03 16:36:26 -05:00
parent 26ab3cb98a
commit 74f9cf9222

View file

@ -25,12 +25,12 @@ class Shipment < Norairrecord::Table
def find_by_email(email)
raise ArgumentError, "no email?" if email.nil? || email.empty?
records :filter => "LOWER({#{self.email_column}})='#{email.downcase}'"
records :filter => "LOWER(TRIM({#{self.email_column}}))='#{email.downcase}'"
end
def check_for_any_by_email(email)
raise ArgumentError, "no email?" if email.nil? || email.empty?
records(:filter => "LOWER({#{self.email_column}})='#{email.downcase}'", fields: [], max_records: 1).any?
records(:filter => "LOWER(TRIM({#{self.email_column}}))='#{email.downcase}'", fields: [], max_records: 1).any?
end
end