Skip to content

Remove deprecated ssid fallback code#229

Draft
skipkayhil wants to merge 2 commits intomasterfrom
hm-xlyxlmxnwnrtyypm
Draft

Remove deprecated ssid fallback code#229
skipkayhil wants to merge 2 commits intomasterfrom
hm-xlyxlmxnwnrtyypm

Conversation

@skipkayhil
Copy link
Member

@skipkayhil skipkayhil commented Feb 12, 2026

For inclusion in 3.0

Depends on #227 being released as 2.x.y

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>
Comment on lines +8 to +10
initializer "activerecord-session_store.deprecator" do |app|
app.deprecators[:"activerecord-session_store"] = SessionStore.deprecator
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we clean up the deprecator code now that its unused? Seems harmless to leave it

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.

1 participant