-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve reification of STI classes #1333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting STI feature that I had not heard of before. As of 6.1, it is a feature of Rails' public API, so I'm happy to support it.
Your description of the issue was excellent. Please boil that down into a few paragraphs, and add them to the comments above #version_reification_class
.
I updated the comments, let me know what you think :) |
Thanks Hans, nice work! |
Released in 12.1.0 |
Checklist
master
(if not - rebase it).code introduces user-observable changes.
and description in grammatically correct, complete sentences.
This fixes #1332.
As discussed, two commits were created, one with failing test cases and one to fix them. Some details about this solution:
I opted to add a new test model, rather than an modify an existing one (e.g.
Animal
) to better represent the specific edge case described in the issue.Futhermore, as
sti_class_for
was only added recently (Rails 6.1), reification falls back to calling the private methodfind_sti_class
. I could not find another way to keep tests for older versions of Rails passing.I left the commits unsquashed for transparency, feel free to squash when merging.