Draft
Conversation
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>
skipkayhil
commented
Feb 12, 2026
Comment on lines
+8
to
+10
| initializer "activerecord-session_store.deprecator" do |app| | ||
| app.deprecators[:"activerecord-session_store"] = SessionStore.deprecator | ||
| end |
Member
Author
There was a problem hiding this comment.
Should we clean up the deprecator code now that its unused? Seems harmless to leave it
2d3a786 to
5753614
Compare
5753614 to
49e811b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For inclusion in 3.0
Depends on #227 being released as 2.x.y