commit
36e6f93ae9
3 changed files with 15 additions and 2 deletions
|
@ -454,7 +454,10 @@ class Procedure < ApplicationRecord
|
||||||
}
|
}
|
||||||
include_list[:groupe_instructeurs] = :instructeurs if !is_different_admin
|
include_list[:groupe_instructeurs] = :instructeurs if !is_different_admin
|
||||||
procedure = self.deep_clone(include: include_list) do |original, kopy|
|
procedure = self.deep_clone(include: include_list) do |original, kopy|
|
||||||
PiecesJustificativesService.clone_attachments(original, kopy)
|
begin
|
||||||
|
PiecesJustificativesService.clone_attachments(original, kopy)
|
||||||
|
rescue ActiveStorage::FileNotFoundError
|
||||||
|
end
|
||||||
end
|
end
|
||||||
procedure.path = SecureRandom.uuid
|
procedure.path = SecureRandom.uuid
|
||||||
procedure.aasm_state = :brouillon
|
procedure.aasm_state = :brouillon
|
||||||
|
|
|
@ -87,8 +87,8 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
|
|
||||||
def displayed_fields_for_headers
|
def displayed_fields_for_headers
|
||||||
[
|
[
|
||||||
*displayed_fields,
|
|
||||||
field_hash('self', 'id', classname: 'number-col'),
|
field_hash('self', 'id', classname: 'number-col'),
|
||||||
|
*displayed_fields,
|
||||||
field_hash('self', 'state', classname: 'state-col')
|
field_hash('self', 'state', classname: 'state-col')
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -647,6 +647,16 @@ describe Procedure do
|
||||||
expect(subject.canonical_procedure).to be_nil
|
expect(subject.canonical_procedure).to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with an pj not found' do
|
||||||
|
let(:procedure) { create(:procedure) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
expect(PiecesJustificativesService).to receive(:clone_attachments).at_least(:once).and_raise(ActiveStorage::FileNotFoundError)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect { procedure.clone(administrateur, false) }.not_to raise_error }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#publish!' do
|
describe '#publish!' do
|
||||||
|
|
Loading…
Reference in a new issue