adds @budget param to apply_filters_and_search

This commit is contained in:
kikito
2016-12-22 20:26:21 +01:00
parent 260b9aa1e4
commit 54bd5aeeb1
2 changed files with 3 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ module Budgets
respond_to :html, :js
def index
@investments = @investments.apply_filters_and_search(params).send("sort_by_#{@current_order}").page(params[:page]).per(10).for_render
@investments = @investments.apply_filters_and_search(@budget, params).send("sort_by_#{@current_order}").page(params[:page]).per(10).for_render
@investment_ids = @investments.pluck(:id)
load_investment_votes(@investments)
end

View File

@@ -7,7 +7,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
before_action :load_heading, only: [:index, :show, :print]
def index
@investments = @investments.apply_filters_and_search(params).page(params[:page])
@investments = @investments.apply_filters_and_search(@budget, params).page(params[:page])
load_investment_votes(@investments)
end
@@ -36,7 +36,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
end
def print
@investments = @investments.apply_filters_and_search(params).order(cached_votes_up: :desc).for_render.limit(15)
@investments = @investments.apply_filters_and_search(@budget, params).order(cached_votes_up: :desc).for_render.limit(15)
load_investment_votes(@investments)
end