Simplify export unicity check and use create_or_find_by

This commit is contained in:
Paul Chavard 2021-03-31 18:19:28 +02:00
parent b0e38f366e
commit fd48b86b7f
6 changed files with 29 additions and 33 deletions

View file

@ -2,5 +2,9 @@ FactoryBot.define do
factory :export do
format { :csv }
groupe_instructeurs { [association(:groupe_instructeur)] }
after(:build) do |export, _evaluator|
export.key = Export.generate_cache_key(export.groupe_instructeurs)
end
end
end