Skip to content

Conversation

@t27duck
Copy link

@t27duck t27duck commented Oct 26, 2025

Purpose

Rails 8.1 deprecated ActiveSupport::Configurable which this gem currently uses.

DEPRECATION WARNING: ActiveSupport::Configurable is deprecated without replacement, and will be removed in Rails 8.2.

You can emulate the previous behavior with `class_attribute`.

Changes

This replaces the use of ActiveSupport::Configurable with an ActiveSupport::OrderedOptions class attribute.

Caveats

Related GitHub issues

N/A

Additional helpful information

Context:

Failure:
ActiveModelSerializers::Test::SchemaTest#test_that_raises_with_a_invalid_json_body [/home/runner/work/active_model_serializers/active_model_serializers/test/active_model_serializers/test/schema_test.rb:129]:
Expected /A JSON text must at least contain two octets!|unexpected token at ''/ to match "unexpected end of input at line 1 column 1".

bin/rails test /home/runner/work/active_model_serializers/active_model_serializers/test/active_model_serializers/test/schema_test.rb:119
Context:

/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:16:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

rails/rails#54621
Context:

warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
Context:

warning: mutex_m was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
You can add mutex_m to your Gemfile or gemspec to silence this warning.
/.rvm/rubies/ruby-3.4.7/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require': cannot load such file -- mutex_m (LoadError)
Context:

Failure:
ActiveModel::Serializer::ReflectionTest#test_no_href_in_vanilla_reflection [/.rvm/gems/ruby-3.4.7/gems/minitest-5.10.3/lib/minitest/assertions.rb:139]:
Expected /undefined method `href'/ to match # encoding: US-ASCII
"undefined method 'href' for an instance of ActiveModel::Serializer::HasOneReflection".
@wasifhossain
Copy link
Member

Thanks @t27duck for the PR!

Could you please rebase your branch on #2493 and then we check again, if CI is happy?

@t27duck t27duck changed the base branch from 0-10-stable to CI-ruby-3-4-rails-8-1 October 28, 2025 11:25
Rails 8.1 deprecated `ActiveSupport::Configurable` which this gem currently uses.

```
DEPRECATION WARNING: ActiveSupport::Configurable is deprecated without replacement, and will be removed in Rails 8.2.

You can emulate the previous behavior with `class_attribute`.
```

This replaces the use of `ActiveSupport::Configurable` with an `ActiveSupport::OrderedOptions` class attribute.
@t27duck t27duck changed the base branch from CI-ruby-3-4-rails-8-1 to 0-10-stable October 28, 2025 11:36
@t27duck
Copy link
Author

t27duck commented Oct 28, 2025

@wasifhossain Ok, I'm pretty sure I did it right.

@wasifhossain wasifhossain requested a review from bf4 October 28, 2025 15:22
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