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: 61222ce01c6bd93dbecfdd0ec23bdf0a9e098401
4
- data.tar.gz: 5a3c86865658cf77430f7dbe6e0e3113d528c445
3
+ metadata.gz: fa40ad5b84196bda4ce9e2067fc70b1fb5662a82
4
+ data.tar.gz: c04b2435c8ea1235a10b9806fe372ccc8735e7c1
5
5
  SHA512:
6
- metadata.gz: ae65bd717ce34c546d8c6d1f737869320bfdbe2744f87e6b4de078e3acc310ca06e8c6aa9c08bb767489ac4077e30daf1edc6a3fed6392a15b62b6b2baac4eba
7
- data.tar.gz: a25e05d17465dd1bf0da3467459d4b0292d30e82d5294f9aac319ca3f95d45fe2bcadd897f5b6bf5c247c90c1fd3fcb979fc00922e45fc4fa28086c1ab730936
6
+ metadata.gz: 6cd7eb9b7c733ece224219d17759d85cabcd2cb43cbc4ae98df4eaa378ed848f91d71cf6d4535b7601d33c7b9e66cfe9ac713bc99b10cd2fe98d3962eaba22c6
7
+ data.tar.gz: 241f32c19320dc4391e00dc5551723e02fa900ac4af314dd427a0d7823ab5f685fb4eeba7a6b9dd15f7c48b1adfc1c9de8739fb438ab804a03ae5ed97307295b
@@ -81,7 +81,7 @@ GIT
81
81
  PATH
82
82
  remote: .
83
83
  specs:
84
- version_serializers (0.1.5)
84
+ version_serializers (0.1.6)
85
85
  active_model_serializers (>= 0.10.0.rc2)
86
86
 
87
87
  GEM
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module VersionSerializer
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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.5
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-02-03 00:00:00.000000000 Z
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