mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
19 lines
405 B
Ruby
19 lines
405 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Spree
|
|
class LogEntry < ActiveRecord::Base
|
|
belongs_to :source, polymorphic: true
|
|
|
|
# Fix for Spree #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
|