File tree 1 file changed +1
-6
lines changed
1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 5
5
require 'jbuilder/errors'
6
6
require 'json'
7
7
require 'active_support/core_ext/hash/deep_merge'
8
- begin
9
- require 'ostruct'
10
- rescue LoadError
11
- end
12
8
13
9
class Jbuilder
14
10
@@key_formatter = nil
@@ -31,7 +27,6 @@ def self.encode(*args, &block)
31
27
end
32
28
33
29
BLANK = Blank . new
34
- NON_ENUMERABLES = defined? ( ::OpenStruct ) ? [ ::Struct , ::OpenStruct ] . to_set : [ ::Struct ] . to_set
35
30
36
31
def set! ( key , value = BLANK , *args , &block )
37
32
result = if ::Kernel . block_given?
@@ -354,7 +349,7 @@ def _scope
354
349
end
355
350
356
351
def _is_collection? ( object )
357
- _object_respond_to? ( object , :map , :count ) && NON_ENUMERABLES . none? { | klass | klass === object }
352
+ _object_respond_to? ( object , :map , :count ) && ! ( :: Struct === object )
358
353
end
359
354
360
355
def _blank? ( value = @attributes )
You can’t perform that action at this time.
0 commit comments