caprese 0.3.19.1 → 0.3.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/caprese/controller/concerns/rendering.rb +15 -13
- data/lib/caprese/version.rb +1 -1
- 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: 4f06336d5d4aafbe84693d22a9182e71e3caa923
|
4
|
+
data.tar.gz: 33975f9eae83da635079afe06a0aedfc2737ca15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 762caaee5e60a49b56c87a3414614f4c7d313345df7b13504f671b305ac8ecc939734ef50203bbd242af921524455775c6fd63a9a496ba158665c5f4531d5c8f
|
7
|
+
data.tar.gz: 2862173fa24e4aa81173f7bc54a563000866abf3c53aafcccbcccc80cae04214c17e01829e4a13d17cb2525d8eee0b0359ae9b437c5db1c85e75d4d1572e424c
|
data/CHANGELOG.md
CHANGED
@@ -9,20 +9,22 @@ module Caprese
|
|
9
9
|
# Override render so we can automatically use our adapter and find the appropriate serializer
|
10
10
|
# instead of requiring that they be explicity stated
|
11
11
|
def render(options = {})
|
12
|
-
options[:
|
13
|
-
|
12
|
+
if options.is_a?(Hash) && options[:json]
|
13
|
+
options[:adapter] = Caprese::Adapter::JsonApi
|
14
|
+
options[:meta] = meta unless meta.empty?
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
if options[:json].respond_to?(:to_ary)
|
17
|
+
if options[:json].first.is_a?(Error)
|
18
|
+
options[:each_serializer] ||= Serializer::ErrorSerializer
|
19
|
+
elsif options[:json].any?
|
20
|
+
options[:each_serializer] ||= serializer_for(options[:json].first)
|
21
|
+
end
|
22
|
+
else
|
23
|
+
if options[:json].is_a?(Error)
|
24
|
+
options[:serializer] ||= Serializer::ErrorSerializer
|
25
|
+
elsif options[:json].present?
|
26
|
+
options[:serializer] ||= serializer_for(options[:json])
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
data/lib/caprese/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caprese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.19.
|
4
|
+
version: 0.3.19.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Landgrebe
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-03-
|
13
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_model_serializers
|