-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 7.0.6, 7.1.0
-
Component/s: Attributes
-
None
ActiveModel has a knob called include_root_in_json (documented in https://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html) which controls the structure of the as_json method output. This knob is supported by Mongoid but its values are not being read correctly.
Test case: https://github.com/p-mongo/tests/blob/master/mongoid-app/lib/tasks/test_4865.rake
Output:
Mongoid: false Foo: false foo: false Sub: false sub: false Mongoid -> true Mongoid: true Foo: false foo: true Sub: false sub: true Foo -> true Mongoid: false Foo: true foo: false Sub: true sub: false Sub -> true Mongoid: false Foo: false foo: false Sub: true sub: false
The class level value is not influenced by the global Mongoid value, and the instance value is not influenced by the class level value.
- is related to
-
MONGOID-4849 ActiveSupport delegation no longer works with 7.1.0 (conflicts with Forwardable.delegate)
- Closed
- links to