Skip to content

Commit

Permalink
Merge pull request solidusio#2280 from jhawthorn/leaky_database
Browse files Browse the repository at this point in the history
Remove after_rollback from LogEntry
  • Loading branch information
jhawthorn committed Oct 20, 2017
2 parents 7bde63d + 4aaeb35 commit 88f531a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion backend/spec/features/admin/orders/log_entries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
)

payment.log_entries.create(
source: payment.source,
details: response.to_yaml
)
end
Expand Down
11 changes: 0 additions & 11 deletions core/app/models/spree/log_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ module Spree
class LogEntry < Spree::Base
belongs_to :source, polymorphic: true

# Fix for https://github.com/spree/spree/issues/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
log = Spree::LogEntry.new
log.source = source
log.details = details
log.save!
end

def parsed_details
@details ||= YAML.load(details)
end
Expand Down

0 comments on commit 88f531a

Please sign in to comment.