Remove unnecesary parameter at Investment to_csv

If there's only one usage of `to_csv` and the parameter has always the
same value... there's no good reason to bother using an additional argument.
This commit is contained in:
Bertocq
2018-04-11 17:19:03 +02:00
parent 1dc8d29f2d
commit 83f4f4f65c
2 changed files with 3 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
format.html
format.js
format.csv do
send_data Budget::Investment.to_csv(@investments, headers: true),
send_data Budget::Investment.to_csv(@investments),
filename: 'budget_investments.csv'
end
end

View File

@@ -328,7 +328,7 @@ class Budget
self.valuator_groups.collect(&:name).compact.join(', ').presence
end
def self.to_csv(investments, options = {})
def self.to_csv(investments)
attrs = [I18n.t("admin.budget_investments.index.table_id"),
I18n.t("admin.budget_investments.index.table_title"),
I18n.t("admin.budget_investments.index.table_supports"),
@@ -339,7 +339,7 @@ class Budget
I18n.t("admin.budget_investments.index.table_feasibility"),
I18n.t("admin.budget_investments.index.table_valuation_finished"),
I18n.t("admin.budget_investments.index.table_selection")]
csv_string = CSV.generate(options) do |csv|
csv_string = CSV.generate(headers: true) do |csv|
csv << attrs
investments.each do |investment|
id = investment.id.to_s