Skip to content

Commit

Permalink
fix: aliased attributes should be sorted by the output key
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed Mar 28, 2023
1 parent ad2f861 commit fc6f4c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/oj_serializers/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def instance_key
def _prepare_serializer
if _sort_attributes_by
@_attributes = _attributes.sort_by { |key, options|
_sort_attributes_by.call(key, options)
_sort_attributes_by.call(key_for(key, options), options)
}.to_h
end
class_eval(code_to_write_to_json)
Expand Down

0 comments on commit fc6f4c1

Please sign in to comment.