Changed the budgets helper so just search for the current budget
This commit is contained in:
@@ -52,8 +52,8 @@ module BudgetsHelper
|
||||
Budget::Ballot.where(user: current_user, budget: @budget).first
|
||||
end
|
||||
|
||||
def investment_tags_select_options
|
||||
Budget::Investment.tags_on(:valuation).order(:name).select(:name).distinct
|
||||
def investment_tags_select_options(budget)
|
||||
Budget::Investment.where(budget_id: budget).tags_on(:valuation).order(:name).select(:name).distinct
|
||||
end
|
||||
|
||||
def budget_published?(budget)
|
||||
|
||||
@@ -25,14 +25,15 @@
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= select_tag :tag_name,
|
||||
options_for_select(investment_tags_select_options, params[:tag_name]),
|
||||
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
|
||||
label: false,
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= select_tag :tag_name,
|
||||
options_for_select(investment_tags_select_options(@budget), params[:tag_name]),
|
||||
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
|
||||
label: false,
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render "advanced_filters", i18n_namespace: "admin.budget_investments.index" %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user