caprese 0.3.19.1 → 0.3.19.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 229427ce58125e220fb6ce8864c87f78670808f3
4
- data.tar.gz: ceb22983137388dcb76f9251d779f6c9e2ab1588
3
+ metadata.gz: 4f06336d5d4aafbe84693d22a9182e71e3caa923
4
+ data.tar.gz: 33975f9eae83da635079afe06a0aedfc2737ca15
5
5
  SHA512:
6
- metadata.gz: 01d1694063ce113ce69fe8975203ead9d33099b6c4ce141962ab1acc1f2bdd9510883a66ca04586fb51876ac294868cd36c368886c1eb56d28e9d4fc7b0f8a12
7
- data.tar.gz: bd81178f1ef091e1bcf24b57308cf7513ce412d118d16cb1d0769648ab0da1adbd27929031ae95966fef69324fc618c37dcbbf5fa9af92530b6d220fbb599331
6
+ metadata.gz: 762caaee5e60a49b56c87a3414614f4c7d313345df7b13504f671b305ac8ecc939734ef50203bbd242af921524455775c6fd63a9a496ba158665c5f4531d5c8f
7
+ data.tar.gz: 2862173fa24e4aa81173f7bc54a563000866abf3c53aafcccbcccc80cae04214c17e01829e4a13d17cb2525d8eee0b0359ae9b437c5db1c85e75d4d1572e424c
data/CHANGELOG.md CHANGED
@@ -103,3 +103,7 @@
103
103
  ## 0.3.19.1
104
104
 
105
105
  * Rescue `Exception` temporarily, so we can always turn off `caprese_style_errors`
106
+
107
+ ## 0.3.19.2
108
+
109
+ * Fix rendering of non-JSON actions
@@ -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[:adapter] = Caprese::Adapter::JsonApi
13
- options[:meta] = meta unless meta.empty?
12
+ if options.is_a?(Hash) && options[:json]
13
+ options[:adapter] = Caprese::Adapter::JsonApi
14
+ options[:meta] = meta unless meta.empty?
14
15
 
15
- if options[:json].respond_to?(:to_ary)
16
- if options[:json].first.is_a?(Error)
17
- options[:each_serializer] ||= Serializer::ErrorSerializer
18
- elsif options[:json].any?
19
- options[:each_serializer] ||= serializer_for(options[:json].first)
20
- end
21
- else
22
- if options[:json].is_a?(Error)
23
- options[:serializer] ||= Serializer::ErrorSerializer
24
- elsif options[:json].present?
25
- options[:serializer] ||= serializer_for(options[:json])
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
 
@@ -1,3 +1,3 @@
1
1
  module Caprese
2
- VERSION = '0.3.19.1'
2
+ VERSION = '0.3.19.2'
3
3
  end
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.1
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-17 00:00:00.000000000 Z
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