diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index c8d61215b..643ccbc74 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -1,11 +1,14 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController include FeatureFlags + include CommentableActions + feature_flag :budgets before_action :restrict_access_to_assigned_items, only: [:show, :edit, :valuate] before_action :load_budget before_action :load_investment, only: [:show, :edit, :valuate] + has_orders %w{oldest}, only: [:show, :edit] has_filters %w{valuating valuation_finished}, only: :index load_and_authorize_resource :investment, class: "Budget::Investment" @@ -36,8 +39,30 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController end end + def show + load_comments + end + + def edit + load_comments + end + private + def load_comments + @commentable = @investment + @comment_tree = CommentTree.new(@commentable, params[:page], @current_order, valuations: true) + set_comment_flags(@comment_tree.comments) + end + + def resource_model + Budget::Investment + end + + def resource_name + resource_model.parameterize('_') + end + def load_budget @budget = Budget.find(params[:budget_id]) end diff --git a/app/views/valuation/budget_investments/_written_by_valuators.html.erb b/app/views/valuation/budget_investments/_written_by_valuators.html.erb index 9dc5a8e8c..965f2b059 100644 --- a/app/views/valuation/budget_investments/_written_by_valuators.html.erb +++ b/app/views/valuation/budget_investments/_written_by_valuators.html.erb @@ -51,3 +51,11 @@