Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@scpike
scpike / incompat_71.rb
Last active February 28, 2024 16:26
Check for silent gem incompatibilities in Rails 7.1
#!/usr/bin/env ruby
# Run like `ruby incompat_71.rb ~/path/to/Gemfile.lock`
# From the team at infield.ai
#
PACKAGES = [['activerecord-import', '1.5.0'],
['anycable-rails', '1.4.1'],
['blazer', '3.0.1'],
['bullet', '7.1.2'],
['data_migrate', '9.2.0'],
['database_cleaner-active_record', '2.1.0'],
@dcuddeback
dcuddeback / after_commit_with_transactional_fixtures.rb
Created August 25, 2011 01:36
Patch ActiveRecord to fire after_commit callbacks at the appropriate time during tests with transactional fixtures.
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