-
Notifications
You must be signed in to change notification settings - Fork 21
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
Rails 7: loading errors with includes of STI belongs_to #142
Labels
Comments
It happens because of preload of
Reduced test case: class Movie < ApplicationRecord
include ChronoModel::TimeMachine
belongs_to :studio, class_name: 'MovieStudio'
end
class MovieStudio < ApplicationRecord
has_many :movies, inverse_of: :studio
end
Movie.as_of(Time.current).includes(:studio).first Ref: rails/rails#40776 |
tagliala
added a commit
that referenced
this issue
Mar 21, 2022
The old behavior tried to detect class names based on Fix: #142
tagliala
added a commit
that referenced
this issue
Mar 21, 2022
The old behavior implemented to support Rails 7 tried to detect class names based on association symbol. This was causing issues when the association name did not match the ruby class This commit fixes the old behavior Fix: #142
@pzac please give a try to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Film.as_of(1.day.ago).first.actors.includes(:addresses)
fails if addresses use STI.The text was updated successfully, but these errors were encountered: