Remove unnecessary condition in valuation investments

The budget is loaded using a method which raises an exception if it
isn't found, so `@budget.present?` will always return true.
This commit is contained in:
Javi Martín
2023-02-09 19:05:11 +01:00
parent b6ed11471e
commit 54fbdf4372

View File

@@ -16,7 +16,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
def index
@heading_filters = heading_filters
@investments = if current_user.valuator? && @budget.present?
@investments = if current_user.valuator?
@budget.investments.visible_to_valuator(current_user.valuator)
.scoped_filter(params.permit(:budget_id, :heading_id), @current_filter)
.order(cached_votes_up: :desc)