You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried dropping in test_after_commit into my Rails project. My specs stalled out and gave the following error when trying to create record with an after_commit:
ActiveRecord::StatementInvalid:
PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block
My after-commit updates the record, but I didn't dig into it and see if that was the cause. Replacing this plugin with @bleonard's monkeypatch from #17 resolved the problem (copied below). Sorry I don't have more information, but thought this might be useful to anyone else who runs into the problem.
require'active_record/connection_adapters/abstract/transaction'moduleActiveRecordmoduleConnectionAdaptersclassSavepointTransaction < OpenTransactiondefperform_commit_with_transactional_fixturesout=perform_commit_without_transactional_fixturescommit_recordsifnumber == 1# last one before test one that's always there, do callbacksoutendalias_method_chain:perform_commit,:transactional_fixturesendendend
The text was updated successfully, but these errors were encountered:
Tried dropping in test_after_commit into my Rails project. My specs stalled out and gave the following error when trying to create record with an after_commit:
My after-commit updates the record, but I didn't dig into it and see if that was the cause. Replacing this plugin with @bleonard's monkeypatch from #17 resolved the problem (copied below). Sorry I don't have more information, but thought this might be useful to anyone else who runs into the problem.
The text was updated successfully, but these errors were encountered: