File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
lib/active_model/serializer Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,10 @@ def success?
1919
2020 # @api private
2121 def serializable_hash ( adapter_options , options , adapter_instance )
22- include_directive = ActiveModel ::Serializer . include_directive_from_options ( adapter_options )
23- adapter_options [ :cached_attributes ] ||= ActiveModel ::Serializer . cache_read_multi ( self , adapter_instance , include_directive )
24- adapter_opts = adapter_options . merge ( include_directive : include_directive )
22+ options [ :include_directive ] ||= ActiveModel ::Serializer . include_directive_from_options ( adapter_options )
23+ options [ :cached_attributes ] ||= ActiveModel ::Serializer . cache_read_multi ( self , adapter_instance , options [ :include_directive ] )
2524 serializers . map do |serializer |
26- serializer . serializable_hash ( adapter_opts , options , adapter_instance )
25+ serializer . serializable_hash ( adapter_options , options , adapter_instance )
2726 end
2827 end
2928
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ def test_fetch_attributes_from_cache
415415 adapter_options = { }
416416 adapter_instance = ActiveModelSerializers ::Adapter ::Attributes . new ( serializers , adapter_options )
417417 serializers . serializable_hash ( adapter_options , options , adapter_instance )
418- cached_attributes = adapter_options . fetch ( :cached_attributes ) . with_indifferent_access
418+ cached_attributes = options . fetch ( :cached_attributes ) . with_indifferent_access
419419
420420 include_directive = ActiveModelSerializers . default_include_directive
421421 manual_cached_attributes = ActiveModel ::Serializer . cache_read_multi ( serializers , adapter_instance , include_directive ) . with_indifferent_access
@@ -446,9 +446,9 @@ def test_cache_read_multi_with_fragment_cache_enabled
446446 serializers . serializable_hash ( adapter_options , options , adapter_instance )
447447
448448 # Should find something with read_multi now
449- adapter_options = { }
449+ options = { }
450450 serializers . serializable_hash ( adapter_options , options , adapter_instance )
451- cached_attributes = adapter_options . fetch ( :cached_attributes )
451+ cached_attributes = options . fetch ( :cached_attributes )
452452
453453 include_directive = ActiveModelSerializers . default_include_directive
454454 manual_cached_attributes = ActiveModel ::Serializer . cache_read_multi ( serializers , adapter_instance , include_directive )
You can’t perform that action at this time.
0 commit comments