version_serializers 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/version_serializers/version.rb +1 -1
- data/lib/version_serializers/versioner.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97eff7d7a40a5d6005542fe3647e2d0b7f8a8e26
|
4
|
+
data.tar.gz: 7bb2744f5b632b4d187fd924ac6d9c19189b5f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b500f7d48eafeed1ad7f0f6506099c31a16f8ad4de291d527be0b11f8e7ba8246172bdffb5bedb533a2d45ef21686442beb01b1de0fe57d1c87807d47d52beb9
|
7
|
+
data.tar.gz: f2770a88646b0cf16f8bfb2c295b7801c845e39a1ac9a4bd7a5d2c2081bfae46157ca24f2a7b19a79f0d539cbdc3229196d388b62793390a4e9eb35a48f00107
|
data/Gemfile.lock
CHANGED
@@ -8,10 +8,14 @@ module VersionSerializer
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.get_rendering_opts(resource, version, opts)
|
11
|
-
resource_class_name = resource.class.to_s
|
11
|
+
resource_class_name = resource.class.to_s
|
12
|
+
serializer_key = :serializer
|
13
|
+
if resource.is_a?(ActiveRecord::Relation)
|
14
|
+
resource_class_name = resource_class_name.split("::").tap(&:pop).join("::")
|
15
|
+
serializer_key = :each_serializer
|
16
|
+
end
|
12
17
|
serializer_class = get_serializer(resource_class_name, version)
|
13
|
-
|
14
|
-
opts.merge!(json: resource, key => serializer_class)
|
18
|
+
opts.merge!(json: resource, serializer_key => serializer_class)
|
15
19
|
end
|
16
20
|
|
17
21
|
def get
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: version_serializers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben D'Angelo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|