mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
add acts_as_paranoid to voucher
This is so the relation
`belongs_to :originator, -> { with_deleted }, polymorphic: true`
setup in Spree::Adjustement works as expected.
This commit is contained in:
committed by
Maikel Linke
parent
a9d9b33f7d
commit
b6213b25e9
@@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
class Voucher < ApplicationRecord
|
||||
acts_as_paranoid
|
||||
|
||||
include CalculatedAdjustments
|
||||
|
||||
belongs_to :enterprise
|
||||
|
||||
6
db/migrate/20230315040748_add_deleted_at_to_vouchers.rb
Normal file
6
db/migrate/20230315040748_add_deleted_at_to_vouchers.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AddDeletedAtToVouchers < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :vouchers, :deleted_at, :datetime
|
||||
add_index :vouchers, :deleted_at
|
||||
end
|
||||
end
|
||||
@@ -1196,7 +1196,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_24_141213) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "enterprise_id"
|
||||
t.datetime "deleted_at"
|
||||
t.index ["code", "enterprise_id"], name: "index_vouchers_on_code_and_enterprise_id", unique: true
|
||||
t.index ["deleted_at"], name: "index_vouchers_on_deleted_at"
|
||||
t.index ["enterprise_id"], name: "index_vouchers_on_enterprise_id"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user