File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ def self.inherited(base)
192192 base . _attributes_data = _attributes_data . dup
193193 base . _reflections = _reflections . dup
194194 base . _links = _links . dup
195+ base . config = ActiveSupport ::InheritableOptions . new ( config )
195196 end
196197
197198 # @return [Array<Symbol>] Key names of declared attributes
Original file line number Diff line number Diff line change 55module ActiveModel
66 class Serializer
77 class ConfigurationTest < ActiveSupport ::TestCase
8+ class CustomSerializer < ActiveModel ::Serializer
9+ config . adapter = :json_api
10+ end
11+
812 def test_collection_serializer
913 assert_equal ActiveModel ::Serializer ::CollectionSerializer , ActiveModelSerializers . config . collection_serializer
1014 end
@@ -29,6 +33,10 @@ def test_setting_array_serializer_sets_collection_serializer
2933 def test_default_adapter
3034 assert_equal :attributes , ActiveModelSerializers . config . adapter
3135 end
36+
37+ def test_subclass_adapter
38+ assert_equal :json_api , CustomSerializer . config . adapter
39+ end
3240 end
3341 end
3442end
You can’t perform that action at this time.
0 commit comments