version_serializers 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa40ad5b84196bda4ce9e2067fc70b1fb5662a82
|
4
|
+
data.tar.gz: c04b2435c8ea1235a10b9806fe372ccc8735e7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd7eb9b7c733ece224219d17759d85cabcd2cb43cbc4ae98df4eaa378ed848f91d71cf6d4535b7601d33c7b9e66cfe9ac713bc99b10cd2fe98d3962eaba22c6
|
7
|
+
data.tar.gz: 241f32c19320dc4391e00dc5551723e02fa900ac4af314dd427a0d7823ab5f685fb4eeba7a6b9dd15f7c48b1adfc1c9de8739fb438ab804a03ae5ed97307295b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module VersionSerializer::ControllerAdditions
|
2
2
|
|
3
3
|
def serialized_render(resource, opts = {})
|
4
|
-
render VersionSerializer::Versioner.get_rendering_opts(resource, request_version).merge(opts)
|
4
|
+
render VersionSerializer::Versioner.get_rendering_opts(resource, request_version, opts.delete(:namespace)).merge(opts)
|
5
5
|
end
|
6
6
|
|
7
7
|
def get_serializer_for(class_name)
|
@@ -7,7 +7,7 @@ module VersionSerializer
|
|
7
7
|
send(:new, version, "#{name}_serializer".classify).get
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.get_rendering_opts(resource, version)
|
10
|
+
def self.get_rendering_opts(resource, version, namespace=nil)
|
11
11
|
resource_class_name = resource.class.to_s
|
12
12
|
serializer_key = :serializer
|
13
13
|
if resource.is_a? Enumerable
|
@@ -19,6 +19,7 @@ module VersionSerializer
|
|
19
19
|
resource_class_name = resource.first.class.to_s
|
20
20
|
end
|
21
21
|
end
|
22
|
+
resource_class_name.prepend("#{namespace}/") if namespace
|
22
23
|
serializer_class = get_serializer(resource_class_name, version)
|
23
24
|
{ json: resource, serializer_key => serializer_class }
|
24
25
|
end
|
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.6
|
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-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|