Conversation
4b93f84 to
c3bbb75
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for ActiveRecord 8.1.x by updating dependencies and adapting to API changes. My review focuses on improving maintainability by reducing code duplication introduced for version compatibility and fixing a critical bug related to a constant not being available due to load order issues. The changes to support the new ActiveRecord version are otherwise looking good.
c3bbb75 to
5e26294
Compare
| e = assert_raises(ArgumentError) { | ||
| connection.rename_index(table_name, "old_idx", too_long_index_name) | ||
| } | ||
| assert_match(/too long; the limit is #{connection.index_name_length} characters/, e.message) |
There was a problem hiding this comment.
The error message is slightly different in 8.1 than in the other versions. We don't really care about the specific error message, only that it is actually an error message about the index name being too long.
| end | ||
| else | ||
| # rubocop:disable Style/OptionalBooleanParameter | ||
| def initialize(name, cast_type, default, sql_type_metadata = nil, null = true, |
There was a problem hiding this comment.
8.1 introduced a new positional parameter cast_type for this constructor.
| if options.key? :default | ||
| sql << " DEFAULT (#{quote_default_expression options[:default], column})" | ||
| sql << if respond_to? :quote_default_expression_for_column_definition, :include_private | ||
| " DEFAULT (#{quote_default_expression_for_column_definition options[:default], column})" |
There was a problem hiding this comment.
This is related to the same cast_type change above. In 8.1, we need to call quote_default_expression_for_column_definition, which again uses the value of cast_type to generate the correct expression.
| @@ -0,0 +1,25 @@ | |||
| # Copyright 2026 Google LLC | |||
There was a problem hiding this comment.
This has been moved to a separate file, so we can require it from two places. It is now also needed in connection.rb.
Adds support for ActiveRecord 8.1.x.
5e26294 to
8debb27
Compare
Adds support for ActiveRecord 8.1.x.
Adds support for ActiveRecord 8.1.x.