Skip to content

Instantly share code, notes, and snippets.

🤓
🦀

Felipe Lima felipecsl

🤓
🦀
Block or report user

Report or block felipecsl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felipecsl
felipecsl / after_commit_with_transactional_fixtures.rb
Created Nov 3, 2011 — forked from outoftime/after_commit_with_transactional_fixtures.rb
Patch ActiveRecord to fire after_commit callbacks at the appropriate time during tests with transactional fixtures.
View after_commit_with_transactional_fixtures.rb
module ActiveRecord
module ConnectionAdapters
module DatabaseStatements
#
# Run the normal transaction method; when it's done, check to see if there
# is exactly one open transaction. If so, that's the transactional
# fixtures transaction; from the model's standpoint, the completed
# transaction is the real deal. Send commit callbacks to models.
#
# If the transaction block raises a Rollback, we need to know, so we don't
You can’t perform that action at this time.