Skip to content
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

Fix deprecation warning about serializer keywords (9) #2375

Merged
merged 14 commits into from
Aug 13, 2024

Conversation

andynu
Copy link
Contributor

@andynu andynu commented Mar 25, 2024

Fix deprecation warning about serializer keywords

DEPRECATION WARNING: Passing the class as positional argument is deprecated and will be removed in Rails 7.2.

Please pass the class as a keyword argument:

  serialize :serialized, type: Array
 (called from <class:TestSerializedColumn> at /home/andy/src/oracle-enhanced/spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:446)

Stacked on #2374

andynu added 4 commits March 25, 2024 09:29
Introduce the _connection method which returns whichever is defined
between @unconfigured_connection or @raw_connection.
verify! ensures that @raw_connection is defined.
Rails commit bd19d1baf1 [1] added a check of logger.level which was not
supported by the MockLogger.

This commit adds a mock level method. And limits the missing_method to
respond only to logging calls, so any other calls will raise a
NoMethodError to make future debugging easier.

[1]
rails/rails@bd19d1b
The SchemaMigration object no longer inherits from ActiveRecord::Base.

See "Move SchemaMigration to an independent object"
rails/rails@436277d

Several methods were renamed, and are no longer available as class
methods on SchemaMigration, but as an instance of SchemaMigration
per connection.

The object per connection seems to remove the need to `reset_table_name`
in the tests. That method is not available on the new object.
@andynu andynu changed the title Fix deprecation warning about serializer keywords Fix deprecation warning about serializer keywords (9/10) Mar 25, 2024
@andynu andynu force-pushed the stack-08-serializer-kwarg branch 2 times, most recently from 551e5b9 to 037cfc2 Compare March 25, 2024 21:39
@andynu andynu changed the title Fix deprecation warning about serializer keywords (9/10) Fix deprecation warning about serializer keywords (9) Mar 26, 2024
andynu added 4 commits March 28, 2024 20:37
Rails commit e6da3ebd6c6 [1] introduces ColumnDefinition validations for
the keywords used in database commands. This commit adds the additional
keywords supported by this gem.

[1] rails/rails@e6da3eb
See rails/rails@07d2407

Both `table_name` and `column_name` were removed in favor of doing
o.left in the visitor pattern. This is just mimicing the adjustments
from upstream.
@andynu andynu force-pushed the stack-08-serializer-kwarg branch 2 times, most recently from 08ad056 to 1e58a6f Compare April 1, 2024 15:58
andynu added 5 commits April 1, 2024 12:09
This extends the existing class level auto_retry functionality to
optionally allow an allow_retry boolean kwarg to allow retry of specific
queries.

This PR preserves the requirement that `autocommit?` be enabled which is the
safer choice.

```
  def with_retry(allow_retry: false) # :nodoc:
    should_retry = (allow_retry || self.class.auto_retry?) && autocommit?
```

See issue rsim#2310
See rails/rails@3682aa1

So the shortening of index names that was added to rails itself
was almost immediately changed to use an 'idx_' prefix instead of an 'ix_'
prefix.

See rails/rails@59f2b06

However, now that rails does shortening. It is an opportunity to
simplify this library and just rely on the rails index name shortening.
    DEPRECATION WARNING: Passing the class as positional argument is deprecated and will be removed in Rails 7.2.

    Please pass the class as a keyword argument:

      serialize :serialized, type: Array
     (called from <class:TestSerializedColumn> at /home/andy/src/oracle-enhanced/spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:446)
@andynu andynu force-pushed the stack-08-serializer-kwarg branch from 1e58a6f to 9ad95c1 Compare April 1, 2024 16:13
@yahonda yahonda merged commit 9917f9d into rsim:master Aug 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants