Before a few renames

This commit is contained in:
Jason Jordan
2026-03-19 00:42:27 -04:00
parent 011ee91707
commit 3300819ed5
46 changed files with 994 additions and 467 deletions
+7 -6
View File
@@ -46,14 +46,15 @@ class Employer < ApplicationRecord
false
end
# def name_to_logo_filename(extension)
# self.employer_trim_name(self.name).titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase)
# end
def name_to_logo_filename(extension)
self.employer_trim_name(self.name).titleize.gsub(/[^a-zA-Z]/, '').concat('Logo').concat(extension.downcase)
end
def employer_trim_name(name)
regex_source = Regexp.union(["health", "plan", "the", "inc", "llc"]).source
def employer_trim_name(name = nil)
employer_name = name.present? ? name : self.name
regex_source = Regexp.union(["health ", "plan", "the", "inc", "llc"]).source
case_insensitive_regex = Regexp.new(regex_source, "i")
name.gsub(case_insensitive_regex, "").squish
employer_name.gsub(case_insensitive_regex, "").gsub(/[^[:alpha:][:space:]]/, "").squish
end
def self.permitted_params(params)