Remove unnecessary safe navigation operator

The heading is used with `find_by_slug_or_id`, which raises an exception
if it isn't found, so executing `@heading.group` after it does not need
the safe navigation operator.
This commit is contained in:
Javi Martín
2020-07-12 23:41:02 +02:00
parent a9900e3f27
commit a38cdb4df3

View File

@@ -148,7 +148,7 @@ module Budgets
def load_heading def load_heading
if params[:heading_id].present? if params[:heading_id].present?
@heading = @budget.headings.find_by_slug_or_id! params[:heading_id] @heading = @budget.headings.find_by_slug_or_id! params[:heading_id]
@assigned_heading = @ballot&.heading_for_group(@heading&.group) @assigned_heading = @ballot&.heading_for_group(@heading.group)
load_map load_map
end end
end end