diff --git a/app/helpers/valuation_helper.rb b/app/helpers/valuation_helper.rb index 311f8e6ec..1c11cb90b 100644 --- a/app/helpers/valuation_helper.rb +++ b/app/helpers/valuation_helper.rb @@ -13,11 +13,6 @@ module ValuationHelper ValuatorGroup.order("name ASC").collect { |g| [ g.name, "group_#{g.id}"] } end - def assigned_valuators(investment) - [investment.valuator_groups.collect(&:name) + - investment.valuators.collect(&:description_or_name)].flatten.join(', ') - end - def assigned_valuators_info(valuators) case valuators.size when 0 diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 594610b6c..c913a562f 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -320,6 +320,14 @@ class Budget investments end + def assigned_valuators + self.valuators.collect(&:description_or_name).compact.join(', ').presence + end + + def assigned_valuation_groups + self.valuator_groups.collect(&:name).compact.join(', ').presence + end + def self.to_csv(investments, options = {}) attrs = [I18n.t("admin.budget_investments.index.table_id"), I18n.t("admin.budget_investments.index.table_title"), diff --git a/app/views/admin/budget_investments/_investments.html.erb b/app/views/admin/budget_investments/_investments.html.erb index 9d52f78d6..aaca20fe8 100644 --- a/app/views/admin/budget_investments/_investments.html.erb +++ b/app/views/admin/budget_investments/_investments.html.erb @@ -63,7 +63,7 @@ <% if investment.valuators.size == 0 && investment.valuator_groups.size == 0 %> <%= t("admin.budget_investments.index.no_valuators_assigned") %> <% else %> - <%= assigned_valuators(investment) %> + <%= investment.assigned_valuators %> <% end %>