From c0d3285b5523a90bb317e86f89b97c028d285953 Mon Sep 17 00:00:00 2001 From: Colby Mchenry Date: Thu, 1 Oct 2026 21:31:06 +0000 Subject: [PATCH] fix(rails): only:/except: are read as %i[], %w(), a string or :only => (#2269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only a bracketed list (and the scoped reader's bare :sym) was read, so maybe's `resources :family_exports, only: %i[new create index]` drew all seven RESTful routes — four to actions the controller lacks, listed by the viewer as routes bound to nothing. Both route readers now share one option reader for every form Rails accepts. Co-authored-by: Claude Opus 5.5 --- CHANGELOG.md | 1 + __tests__/rails-only-except-forms.test.ts | 57 +++++++++++++++++++++++ src/resolution/frameworks/ruby.ts | 37 +++++++++++---- 3 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 __tests__/rails-only-except-forms.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df18302c..32132da00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixes +- In Rails apps, a `resources` line's `only:` and `except:` are now read in every form Rails accepts: `%i[new create index]`, `%w(index show)`, a quoted name, and the older `:only => [...]`. Before, only a bracketed list was read, so maybe's `resources :family_exports, only: %i[new create index]` became all seven routes, four of them to actions the controller doesn't have. - In Vue, Svelte and Astro files, a component now owns its script, and what a `