Skip to content

Comments

Deprecate sessid column fallback#227

Merged
byroot merged 1 commit intomasterfrom
hm-muwnmktwwomllpnu
Feb 17, 2026
Merged

Deprecate sessid column fallback#227
byroot merged 1 commit intomasterfrom
hm-muwnmktwwomllpnu

Conversation

@skipkayhil
Copy link
Member

@skipkayhil skipkayhil commented Feb 12, 2026

Closes #225

I'm working on removing queries in my application that should be going through the SchemaCache in production but currently are not. I found that the sessions table is being queried during runtime due to the reset_column_information when the class is loaded (which clears the SchemaCache for the sessions table).

This commit deprecates the cause of the schema cache clearing: the sessid fallback. This code checks the model's columns and conditionally redefines methods to allow using sessid instead of session_id.

The session_id -> sessid fallback has been in place for twenty years, I'd be surprised if there's even a single app still using sessid.

Also of note: many app.deprecators implementations check that the app responds to deprecators (which was added in Rails 7.1), but that's our minimum version so we can skip it.

I'm working on removing queries in my application that should be going
through the SchemaCache in production but currently are not. I found
that the `sessions` table is being queried during runtime due to the
`reset_column_information` when the class is loaded (which clears the
SchemaCache for the `sessions` table).

This commit deprecates the cause of the schema cache clearing: the
`sessid` fallback. This code checks the model's columns and
conditionally redefines methods to allow using `sessid` instead of
`session_id`.

The `session_id` -> `sessid` fallback has been in place for [twenty
years][1], I'd be surprised if there's even a single app still using
`sessid`.

Also of note: many `app.deprecators` implementations check that the
`app` responds to `deprecators` (which was added in Rails 7.1), but
that's our minimum version so we can skip it.

[1]: rails/rails@452442d

Co-authored-by: elasticspoon <quesadillaman@gmail.com>
@byroot byroot merged commit a3d1bc0 into master Feb 17, 2026
46 checks passed
@byroot byroot deleted the hm-muwnmktwwomllpnu branch February 17, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants