Simplify export unicity check and use create_or_find_by
This commit is contained in:
parent
b0e38f366e
commit
fd48b86b7f
6 changed files with 29 additions and 33 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue