RepoJournal
Rails

@rails

Ruby on Rails — Shopify, Basecamp, GitHub all run on it

Pick a date

The Wire · Showcase

Rails Fixes Composite Foreign Key Touch Bug, Solid Cable Drops Ruby 3.1

By RepoJournal · Filed · About Rails

Rails patched a silent failure in composite foreign key associations where touch: true would skip updating the old record when relationships changed.

The composite foreign key fix [1] [2] addresses a real production problem: when a belongs_to with touch: true and composite keys changed targets, only the new associated record got its updated_at timestamp. The old one was silently skipped because the touch_record method was doing a hash lookup with the entire array as key, but saved_changes tracks individual column names. Now each column is checked individually to reconstruct the old composite key. This is a solid catch for anyone using composite foreign keys in associations [3]. Separately, Rails test infrastructure improved with better database cleanup after bin/setup tests [4] [5], preventing stale app_development and app_test databases from polluting the test environment. On the Solid Cable desk, v4.0.0 shipped with breaking changes: Ruby 3.1 and 3.2 support dropped [6], and the library now eagerly initializes last_id to avoid skipping messages on reconnection [6]. If you're running Solid Cable on Ruby 3.1 or 3.2, you're locked to v3.x.

Action items

References

  1. [1] Merge pull request #57158 from romulostorel/fix-composite-fk-touch-record rails/rails
  2. [2] Fix touching records via composite foreign keys rails/rails
  3. [3] Fix touch_record for composite foreign keys ↗ rails/rails
  4. [4] Merge pull request #57457 from yahonda/yahonda/railties-bin-setup-test-db-cleanup rails/rails
  5. [5] Drop generated app databases after `test_bin_setup_output` rails/rails
  6. [6] v4.0.0 ↗ rails/solid_cable

FAQ

What changed in Rails on May 25, 2026?
Rails patched a silent failure in composite foreign key associations where touch: true would skip updating the old record when relationships changed.
What should Rails teams do about it?
Update Solid Cable to v4.0.0 only if you're on Ruby 3.3+ • If using composite foreign keys with touch: true, pull the latest Rails main to get the fix • Check test database cleanup in your CI if you run bin/setup tests
Which Rails repositories shipped on May 25, 2026?
rails/rails, rails/solid_cable

For your repos

The showcase is a teaser.
Your wire is the product.

Same engine. Different stack. Below: what changes when the wire is yours.

Showcase wire

  • 14 famous open source orgs
  • One wire per day
  • Public, generic
  • Read on the web, when you remember

Your wire

  • Up to 1,500 of your repos - orgs, deps, vendors
  • Morning and evening briefs
  • Action items routed to your team
  • Slack delivery, email, breaking-news CVE alerts

Want a hands-on demo first? Ask a current user for an invite link.