-
Notifications
You must be signed in to change notification settings - Fork 12
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
[WIP] Rails 7.1 support #168
base: master
Are you sure you want to change the base?
Conversation
Rails 7.1 removed the table_name alias to name so just use name: See: https://www.github.com/rails/rails/pull/46864 Rails 7.1 removed the writer for the table_alias so set the instance variable. We will need to see if there is a way to do this that's less brittle. See: https://www.github.com/rails/rails/pull/48927
# use a dup to not modify the primary table in the model | ||
to_table = to_table.dup | ||
# use a table alias to not conflict with table name in the primary query | ||
to_table.table_alias = "#{to_table.table_name}_sub" | ||
to_table.instance_variable_set(:@table_alias, "#{to_table.name}_sub") |
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.
@kbrock do we need to set a table alias in this way? I didn't look to see if this was yours or Nick's comment. Clearly, they don't want to let us set it so I concerned this will change in the future.
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.
aah - now I remember
rails uses a manager to manage the names of the tables (so you can do a self join and it all works)
I had been meaning to change this for the next revision
If I remember correctly, this is tied to 3 test failures - the only real failures for rails.
They are real faiulres.
Pretty sure we don't want name
here.
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.
I'll leave this WIP... feel free to take this change in part or whole and change it while I'm away.
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.
I'm putting together a PR for tests that will verify this change
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.
@kbrock do you have suggestions on getting this change in? I'm not a fan of this change so I'm open to something better.
Add Rails 7.1 and ruby 3.2 and 3.3 to the test matrix.
Add ability to test with rails 7.2 locally.
Rails 7.1 removed the table_name alias to name so just use name:
See: https://www.github.com/rails/rails/pull/46864
Rails 7.1 removed the writer for the table_alias so set the instance
variable. We will need to see if there is a way to do this that's less brittle.
See: https://www.github.com/rails/rails/pull/48927