Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Remove after_rollback from LogEntry #564

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

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