Browse Source

lint: use hash lookup where possible

pull/2115/head
natdeanlewissoftwire 12 months ago
parent
commit
3d8c084204
  1. 12
      app/helpers/home_helper.rb

12
app/helpers/home_helper.rb

@ -16,11 +16,7 @@ module HomeHelper
end end
def heading_for_user_role(user) def heading_for_user_role(user)
case user.role ROLE_HEADINGS[user.role]
when "data_provider" then "Complete your logs"
when "data_coordinator" then "Manage your data"
when "support" then "Manage all data"
end
end end
def data_subheading(user, type) def data_subheading(user, type)
@ -66,4 +62,10 @@ module HomeHelper
"View all #{type}" "View all #{type}"
end end
end end
ROLE_HEADINGS = {
"data_provider" => "Complete your logs",
"data_coordinator" => "Manage your data",
"support" => "Manage all data",
}.freeze
end end

Loading…
Cancel
Save