Skip to content

Commit fabb0c5

Browse files
committed
Remove use of ActiveSupport::Configurable
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.
1 parent 8e1b223 commit fabb0c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/active_model/serializer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# reified when subclassed to decorate a resource.
1414
module ActiveModel
1515
class Serializer
16+
class_attribute :config
17+
self.config = ActiveSupport::OrderedOptions.new
18+
1619
undef_method :select, :display # These IO methods, which are mixed into Kernel,
1720
# sometimes conflict with attribute names. We don't need these IO methods.
1821

@@ -30,7 +33,6 @@ class Serializer
3033
autoload :HasOneReflection
3134
autoload :HasManyReflection
3235
end
33-
include ActiveSupport::Configurable
3436
include Caching
3537

3638
# @param resource [ActiveRecord::Base, ActiveModelSerializers::Model]

0 commit comments

Comments
 (0)