mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 23:45:21 +02:00
Fix rubocop linting errors
This commit is contained in:
parent
d1eef076f0
commit
d9f78b167e
1 changed files with 6 additions and 6 deletions
|
@ -3,26 +3,26 @@ module AccountsHelper
|
|||
content = capture(&block)
|
||||
render "accounts/summary_card", title: title, content: content
|
||||
end
|
||||
|
||||
|
||||
# Format account subtype to be more friendly
|
||||
def format_account_subtype(subtype)
|
||||
return nil if subtype.nil?
|
||||
|
||||
|
||||
# Mapping of special cases
|
||||
special_cases = {
|
||||
"ira" => "IRA",
|
||||
"401k" => "401(k)",
|
||||
"hsa" => "HSA",
|
||||
"hsa" => "HSA"
|
||||
}
|
||||
|
||||
|
||||
# Convert to title case
|
||||
subtype_string = subtype.titleize
|
||||
|
||||
|
||||
special_cases.each do |key, value|
|
||||
# Use word boundaries to ensure we're replacing whole words
|
||||
subtype_string = subtype_string.gsub(/\b#{key}\b/i, value)
|
||||
end
|
||||
|
||||
|
||||
subtype_string
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue