Merge branch 'master' into feature/budget_phases
This commit is contained in:
@@ -2,7 +2,7 @@ class Admin::BudgetsController < Admin::BaseController
|
||||
include FeatureFlags
|
||||
feature_flag :budgets
|
||||
|
||||
has_filters %w{current finished}, only: :index
|
||||
has_filters %w{open finished}, only: :index
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
layout :set_layout
|
||||
respond_to :html
|
||||
helper_method :current_budget
|
||||
|
||||
private
|
||||
|
||||
@@ -120,4 +121,8 @@ class ApplicationController < ActionController::Base
|
||||
params[:filter] ||= "selected"
|
||||
end
|
||||
end
|
||||
|
||||
def current_budget
|
||||
Budget.current
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ class Management::BudgetsController < Management::BaseController
|
||||
end
|
||||
|
||||
def print_investments
|
||||
@budgets = Budget.current.order(created_at: :desc).page(params[:page])
|
||||
@budget = Budget.current
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -5,10 +5,10 @@ class Valuation::BudgetsController < Valuation::BaseController
|
||||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
@budgets = @budgets.current.order(created_at: :desc).page(params[:page])
|
||||
@investments_with_valuation_open = {}
|
||||
@budgets.each do |b|
|
||||
@investments_with_valuation_open[b.id] = b.investments
|
||||
@budget = Budget.current
|
||||
if @budget.present?
|
||||
@investments_with_valuation_open = {}
|
||||
@investments_with_valuation_open = @budget.investments
|
||||
.by_valuator(current_user.valuator.try(:id))
|
||||
.valuation_open
|
||||
.count
|
||||
|
||||
Reference in New Issue
Block a user