mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-16 04:24:23 +00:00
Bring base files from spree_core
This commit is contained in:
16
app/models/spree/log_entry.rb
Normal file
16
app/models/spree/log_entry.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module Spree
|
||||
class LogEntry < ActiveRecord::Base
|
||||
belongs_to :source, polymorphic: true
|
||||
|
||||
# Fix for #1767
|
||||
# If a payment fails, we want to make sure we keep the record of it failing
|
||||
after_rollback :save_anyway
|
||||
|
||||
def save_anyway
|
||||
log = Spree::LogEntry.new
|
||||
log.source = source
|
||||
log.details = details
|
||||
log.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user