refactor(procedure): remove unused code

This commit is contained in:
Paul Chavard 2022-03-31 16:16:38 +02:00
parent ba79a65015
commit 706c648be8
2 changed files with 0 additions and 32 deletions

View file

@ -513,27 +513,6 @@ class Procedure < ApplicationRecord
self.dossiers.state_not_brouillon.size
end
def export_filename(format)
procedure_identifier = path || "procedure-#{id}"
"dossiers_#{procedure_identifier}_#{Time.zone.now.strftime('%Y-%m-%d_%H-%M')}.#{format}"
end
def export(dossiers)
ProcedureExportService.new(self, dossiers)
end
def to_csv(dossiers)
export(dossiers).to_csv
end
def to_xlsx(dossiers)
export(dossiers).to_xlsx
end
def to_ods(dossiers)
export(dossiers).to_ods
end
def procedure_overview(start_date, groups)
ProcedureOverview.new(self, start_date, groups)
end

View file

@ -1059,17 +1059,6 @@ describe Procedure do
it { expect(Procedure.default_sort).to eq({ "table" => "self", "column" => "id", "order" => "desc" }) }
end
describe "#export_filename" do
before { Timecop.freeze(Time.zone.local(2018, 1, 2, 23, 11, 14)) }
after { Timecop.return }
subject { procedure.export_filename(:csv) }
let(:procedure) { create(:procedure, :published) }
it { is_expected.to eq("dossiers_#{procedure.path}_2018-01-02_23-11.csv") }
end
describe '#new_dossier' do
let(:procedure) do
create(:procedure,