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

@ -0,0 +1,6 @@
class AddCacheKeyToExports < ActiveRecord::Migration[6.1]
def change
add_column :exports, :key, :text
add_index :exports, [:format, :key], unique: true
end
end