-
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
ActiveRecord 6.1 compatibility #109
Merged
Merged
Conversation
This file contains 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
amicojeko
reviewed
Oct 7, 2021
1dd356d
to
a6d92dd
Compare
2e49472
to
78c5901
Compare
594669a
to
2ee03d6
Compare
is generating a different query on Rails 6.1 Bisected to rails/rails#40540 6.1 > self.joins(:foo).to_sql
"SELECT \"history\".\"bars\".* FROM \"history\".\"bars\" INNER JOIN (SELECT \"history\".\"foos\".* FROM \"history\".\"foos\" WHERE ( '2021-11-06 12:31:29.796839'::timestamp <@ history.foos.validity )) \"foos\" ON \"foos\".\"id\" = \"history\".\"bars\".\"foo_id\""
> self.except(:order).joins(:foo).to_sql
"SELECT \"history\".\"bars\".* FROM \"history\".\"bars\" INNER JOIN (SELECT \"history\".\"foos\".* FROM \"history\".\"foos\" WHERE ( '2021-11-06 12:29:40.275442'::timestamp <@ history.foos.validity )) \"foos\" ON \"foos\".\"id\" = \"history\".\"bars\".\"foo_id\"" 6.0 > self.joins(:foo).to_sql
"SELECT \"history\".\"bars\".* FROM \"history\".\"bars\" INNER JOIN (SELECT \"history\".\"foos\".* FROM \"history\".\"foos\" WHERE ( '2021-11-06 12:32:04.216929'::timestamp <@ history.foos.validity )) \"foos\" ON \"foos\".\"id\" = \"history\".\"bars\".\"foo_id\""
> self.except(:order).joins(:foo).to_sql
"SELECT \"history\".\"bars\".* FROM \"history\".\"bars\" INNER JOIN \"foos\" ON \"foos\".\"id\" = \"history\".\"bars\".\"foo_id\""
|
2ee03d6
to
b821f6c
Compare
tagliala
commented
Nov 8, 2021
b821f6c
to
c809830
Compare
c809830
to
16273c9
Compare
@gridanjbf any chance to squash bf3addf and cfa3c7f and push force a single commit? |
i will do a reset --soft and then commit |
0c4fa45
to
c098eb5
Compare
tagliala
commented
Nov 15, 2021
tagliala
commented
Nov 15, 2021
tagliala
commented
Nov 15, 2021
We can now drop efdd9c7 |
d9ec413
to
2b649e4
Compare
TODO: remove this commit
has_and_belongs_to_many
In the `else` case we should keep `ass.foreign_key` because we are in the `has_many` case. foo has many bars and we are in :bars association. `association.foreign_key` returns `foo_id`, `association.association_foreign_key` returns `:bar_id` because it does `Bar.foreign_key`
2b649e4
to
02360cb
Compare
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.
Bringing AR 6.1 compatibility require more work, because Rails 6.1 supports multiple databases and that required a complete rewrite of the database configuration
The method used by Chrono Model to implement rake tasks,
current_config
, is deprecated and will be removed in 6.2, but changing the rake tasks should not be a huge dealAlso, some
schema
related are deprecated and will be removed in Rails 6.2TODO: