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?
19
19
20
20
# @api private
21
21
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 ] )
25
24
serializers . map do |serializer |
26
- serializer . serializable_hash ( adapter_opts , options , adapter_instance )
25
+ serializer . serializable_hash ( adapter_options , options , adapter_instance )
27
26
end
28
27
end
29
28
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ def test_fetch_attributes_from_cache
415
415
adapter_options = { }
416
416
adapter_instance = ActiveModelSerializers ::Adapter ::Attributes . new ( serializers , adapter_options )
417
417
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
419
419
420
420
include_directive = ActiveModelSerializers . default_include_directive
421
421
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
446
446
serializers . serializable_hash ( adapter_options , options , adapter_instance )
447
447
448
448
# Should find something with read_multi now
449
- adapter_options = { }
449
+ options = { }
450
450
serializers . serializable_hash ( adapter_options , options , adapter_instance )
451
- cached_attributes = adapter_options . fetch ( :cached_attributes )
451
+ cached_attributes = options . fetch ( :cached_attributes )
452
452
453
453
include_directive = ActiveModelSerializers . default_include_directive
454
454
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