Sha256: 07ed2779c04c9bb3974ee916c051625bee97b9597ab836cca150d664719aca54
Contents?: true
Size: 793 Bytes
Versions: 21
Compression:
Stored size: 793 Bytes
Contents
module Spree class LogEntry < Spree::Base if defined?(Spree::Security::LogEntries) include Spree::Security::LogEntries end 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, if: proc { !Rails.env.test? } def save_anyway Spree::LogEntry.create!(source: source, details: details) end def parsed_details @details ||= if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') YAML.safe_load(details, permitted_classes: [ActiveMerchant::Billing::Response]) else YAML.safe_load(details, [ActiveMerchant::Billing::Response]) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems