RepoJournal
Rails

@rails

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

Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

One email a day. Unsubscribe in one click.

Pick a date

Topics: Ruby Full archive →

The Wire · Showcase

RAILS FIXES THREE CRITICAL QUERY BUGS OVERNIGHT

By RepoJournal · Filed · About Rails

Rails patched three separate issues where SQL queries were silently producing wrong results: `regroup` was duplicating columns, `distinct.sum` was dropping its deduplication flag in grouped queries, and `week_field` was emitting invalid ISO week strings at year boundaries.

The `regroup` method is documented as shorthand for `unscope(:group).group(fields)`, but it wasn't honoring the deduplication that `group` performs [1]. Call `regroup(:a, :a)` and you'd get a duplicate column; call `unscope(:group).group(:a, :a)` and it would deduplicate. That inconsistency is now fixed [2]. Separately, a grouped sum with distinct was silently dropping the DISTINCT keyword, causing queries to return numerically wrong totals [3]. The ungrouped path was setting the flag correctly; the grouped path wasn't. Both issues are merged. A third fix addresses `week_field` generating invalid week strings at ISO year boundaries [7]. On the bootsnap side, the YAML cache was mutating its own arguments during cache misses, replacing `symbolize_names` with an unsupported `symbolize_keys` parameter that would crash psych [4]. That's patched [5]. CacheStore session deletion also now honors the `drop` option correctly [6].

One email a day. Unsubscribe in one click.

Action items

References

  1. [1] Deduplicate columns in `regroup` rails/rails
  2. [2] Merge pull request #57897 from 55728/fix-regroup-deduplication rails/rails
  3. [3] Apply DISTINCT to a grouped `sum` rails/rails
  4. [4] Fix `CompileCache::YAML` cache options mutation & `symbolize_{keys,names}` ↗ rails/bootsnap
  5. [5] Merge pull request #558 from viralpraxis/fix-yaml-cache-kwargs-mutation rails/bootsnap
  6. [6] Merge pull request #57870 from 55728/fix-cache-session-store-honor-drop rails/rails
  7. [7] Merge pull request #57890 from 55728/fix-week-field-iso-week-year rails/rails

Quick answers

What shipped in Rails on June 29, 2026?
Rails patched three separate issues where SQL queries were silently producing wrong results: `regroup` was duplicating columns, `distinct.sum` was dropping its deduplication flag in grouped queries, and `week_field` was emitting invalid ISO week strings at year boundaries. In total, 18 commits and 13 pull requests landed.
Who contributed to Rails on June 29, 2026?
1 developer shipped this update, including viralpraxis.
What were the notable Rails updates?
Deduplicate columns in `regroup`, Merge pull request #57897 from 55728/fix-regroup-deduplication, and Apply DISTINCT to a grouped `sum`.

More from @rails

Daily updates, in your inbox

Follow Rails

Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

One email a day. Unsubscribe in one click. Read a past issue →

Elsewhere on the wire

Want every project, not just this one?

We use privacy-friendly analytics (Google Analytics, IP-anonymized) to see which pages help readers. No ads, and we never sell your data. See our Privacy Policy.