oj_serializers 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/oj_serializers/controller_serialization.rb +1 -1
- data/lib/oj_serializers/serializer.rb +7 -1
- data/lib/oj_serializers/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a827275a95a3c81ce1da683105293bda56d4986793460c2e447f65dc44c870cb
|
|
4
|
+
data.tar.gz: 525a32c3ef350992b04cbf5ca3040fe037530a748e32fac551cb5457c09c7913
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 775586813cd40602dde589feb39fdbf0694e40df35532e905482cef9d97c2fb54ee00a20602e15c710fae654b649d6294214ae8fff00ea9e6ace802557c76093
|
|
7
|
+
data.tar.gz: 51a33d1a021e9d5331c5b1078ee9575ae4c02e08019c60f3c5ce2af5a34f6b6a61e18f6b5da925f5e39538362235f8292b649013d1683964108b5a69f7a361bc
|
data/CHANGELOG.md
CHANGED
|
@@ -25,7 +25,7 @@ module OjSerializers::ControllerSerialization
|
|
|
25
25
|
if serializer_class && serializer_class < OjSerializers::Serializer
|
|
26
26
|
super(OjSerializers::JsonStringEncoder.encode_to_json(resource, **options), options.except(:root, :serializer, :each_serializer))
|
|
27
27
|
else
|
|
28
|
-
super(resource,
|
|
28
|
+
super(resource, options)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -713,7 +713,13 @@ protected
|
|
|
713
713
|
if sort_by == :name
|
|
714
714
|
sort_by = ->(name, options, _) { options[:identifier] ? "__#{name}" : name }
|
|
715
715
|
elsif !sort_by || sort_by == :definition
|
|
716
|
-
sort_by = ->(name, options, index) {
|
|
716
|
+
sort_by = ->(name, options, index) {
|
|
717
|
+
if options[:identifier]
|
|
718
|
+
0 - (_attributes.count - index)
|
|
719
|
+
else
|
|
720
|
+
index
|
|
721
|
+
end
|
|
722
|
+
}
|
|
717
723
|
end
|
|
718
724
|
|
|
719
725
|
attributes.sort_by.with_index { |(name, options), index| sort_by.call(name, options, index) }.to_h
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oj_serializers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maximo Mussini
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: oj
|
|
@@ -53,7 +52,6 @@ metadata:
|
|
|
53
52
|
source_code_uri: https://github.com/ElMassimo/oj_serializers
|
|
54
53
|
changelog_uri: https://github.com/ElMassimo/oj_serializers/blob/master/CHANGELOG.md
|
|
55
54
|
rubygems_mfa_required: 'true'
|
|
56
|
-
post_install_message:
|
|
57
55
|
rdoc_options: []
|
|
58
56
|
require_paths:
|
|
59
57
|
- lib
|
|
@@ -68,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
68
66
|
- !ruby/object:Gem::Version
|
|
69
67
|
version: '0'
|
|
70
68
|
requirements: []
|
|
71
|
-
rubygems_version: 3.
|
|
72
|
-
signing_key:
|
|
69
|
+
rubygems_version: 3.6.9
|
|
73
70
|
specification_version: 4
|
|
74
71
|
summary: A lighter JSON serializer for Ruby Objects in Rails. Easily migrate away
|
|
75
72
|
from Active Model Serializers.
|