File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ def process_options(options)
85
85
raise ArgumentError . new ( "`params` option passed to serializer must be a hash" ) unless @params . is_a? ( Hash )
86
86
87
87
if options [ :include ] . present?
88
- @includes = options [ :include ] . delete_if ( &:blank? ) . map ( &:to_sym )
88
+ @includes = options [ :include ] . reject ( &:blank? ) . map ( &:to_sym )
89
89
self . class . validate_includes! ( @includes )
90
90
end
91
91
end
Original file line number Diff line number Diff line change @@ -473,6 +473,16 @@ class BlahSerializer
473
473
options [ :include ] = [ :actors ]
474
474
expect ( serializable_hash [ 'included' ] ) . to be_blank
475
475
end
476
+
477
+ end
478
+ end
479
+
480
+ context 'when include has frozen array' do
481
+ let ( :options ) { { include : [ :actors ] . freeze } }
482
+ let ( :json ) { MovieOptionalRelationshipSerializer . new ( movie , options ) . serialized_json }
483
+
484
+ it 'does not raise and error' do
485
+ expect ( json [ 'included' ] ) . to_not be_blank
476
486
end
477
487
end
478
488
You can’t perform that action at this time.
0 commit comments