Closed osanay closed 3 months ago
LGTM! Do you think we need a major release for this change?
Thank you! This pull request addresses a bug related to nested objects. Since it fixes an existing issue and ensures the correct behavior, I believe a minor or patch release would be appropriate. However, there is also the change in the behavior of persisting unknown attributes in the database, so if there are new features or other changes planned for the near future, it might make sense to include this fix in a major release.
In the current latest version 2.4.0, I noticed that serialization options are not applied to nested objects. For example, when specifying the
serialize_enums_using_as_json
option in theas_json
method, it behaves as follows:The same issue occurs with the
serialize_unknown_attributes
option.This problem seems to arise because the
as_json
method serializes nested objects recursively; however, the serialization options are not passed down to the nested objects.I resolved this issue by storing the serialization options as attributes in the
StoreModel::Model
object. This ensures that the options are correctly inherited by nested objects during serialization.I would appreciate your feedback on this solution.