rocket_pants 1.12.0 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,7 +69,7 @@ module RocketPants
69
69
  object = normalise_to_serializer object, options
70
70
 
71
71
  # Convert the object using a standard grape-like lookup chain.
72
- if object.is_a?(Array) || object.is_a?(Set) || (options[:each_serializer] && !options[:serializer])
72
+ if object.respond_to?(:to_ary) || object.is_a?(Set) || (options[:each_serializer] && !options[:serializer])
73
73
  suboptions = options.dup
74
74
  if each_serializer = suboptions.delete(:each_serializer)
75
75
  suboptions[:serializer] = each_serializer
@@ -88,7 +88,7 @@ module RocketPants
88
88
  return object unless RocketPants.serializers_enabled?
89
89
  serializer = options.delete(:serializer)
90
90
  # AMS overrides active_model_serializer, so we ignore it and tell it to go away, generally...
91
- serializer = object.active_model_serializer if object.respond_to?(:active_model_serializer) && serializer.nil? && !object.is_a?(Array)
91
+ serializer = object.active_model_serializer if object.respond_to?(:active_model_serializer) && serializer.nil? && !object.respond_to?(:to_ary)
92
92
  return object unless serializer
93
93
  SerializerWrapper.new serializer, object
94
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocket_pants
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-20 00:00:00.000000000 Z
12
+ date: 2015-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack