Skip to content

Conversation

@janko
Copy link

@janko janko commented Nov 11, 2025

Purpose

Overriding configuration such as adapter in subclasses currently affects all serializers on 0-10-stable.

ActiveModelSerializers.config.adapter = :json_api

class FooSerializer < ActiveModel::Serializer
  config.adapter = :attributes
end

ActiveModelSerializers.config.adapter #=> :attributes

Changes

We make copy of configuration object on subclassing, just like was done in rails/rails#53970.

Related GitHub issues

This was a regression after removing ActiveSupport::Configurable in #2492.

@wasifhossain wasifhossain merged commit b7b12f7 into rails-api:0-10-stable Nov 11, 2025
19 checks passed
@janko janko deleted the fix-global-config branch November 11, 2025 16:33
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