File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 55require 'jbuilder/errors'
66require 'json'
77require 'active_support/core_ext/hash/deep_merge'
8- begin
9- require 'ostruct'
10- rescue LoadError
11- end
128
139class Jbuilder
1410 @@key_formatter = nil
@@ -31,7 +27,6 @@ def self.encode(*args, &block)
3127 end
3228
3329 BLANK = Blank . new
34- NON_ENUMERABLES = defined? ( ::OpenStruct ) ? [ ::Struct , ::OpenStruct ] . to_set : [ ::Struct ] . to_set
3530
3631 def set! ( key , value = BLANK , *args , &block )
3732 result = if ::Kernel . block_given?
@@ -354,7 +349,7 @@ def _scope
354349 end
355350
356351 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 )
358353 end
359354
360355 def _blank? ( value = @attributes )
You can’t perform that action at this time.
0 commit comments