Rails Daily

Rails Daily: Composite Keys and Documentation Updates

Three pull requests were merged addressing composite foreign key touch behavior, form helper documentation, and test cleanup. The most significant change fixes a silent bug where belongs_to associations with composite foreign keys failed to touch old records when relationships changed.

Duration: PT1M16S

https://podlog.io/listen/rails-daily-a67c65cf/episode/rails-daily-composite-keys-and-documentation-updates-1b8c6764

Transcript

Good morning, this is Rails Daily for Tuesday, May 25th, 2026.

romulostorel merged a fix for touch_record with composite foreign keys. This addresses a silent bug where belongs_to associations with composite foreign keys and touch: true would fail to update the old associated record's timestamp when the foreign key changed. The fix ensures both old and new records are properly touched during relationship changes.

cgunther merged documentation improvements for options_from_collection_for_select. The update clarifies that value_method and text_method arguments accept Proc objects in addition to string and symbol method names, filling a gap in the existing documentation.

yahonda merged a test cleanup fix that properly drops PostgreSQL databases created during bin setup tests. The change adds an ensure clause to remove app_development and app_test databases that were previously left behind after test runs.

What's next: The composite foreign key fix resolves a data integrity issue that could affect audit trails and caching strategies. The documentation update should help developers better utilize form helper flexibility.

That's your Rails update for today. Back tomorrow with more from the Rails repository.