Fix Style/HashSlice cop violations (#33720)

This commit is contained in:
Matt Jankowski 2025-01-24 11:57:55 -05:00 committed by GitHub
parent 469c8f8db1
commit f73df1f2b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base
options = serialization_options(options)
serialized_hash = serializer.serializable_hash(options.merge(named_contexts: named_contexts, context_extensions: context_extensions))
serialized_hash = serialized_hash.select { |k, _| options[:fields].include?(k) } if options[:fields]
serialized_hash = serialized_hash.slice(*options[:fields]) if options[:fields]
serialized_hash = self.class.transform_key_casing!(serialized_hash, instance_options)
{ '@context': serialized_context(named_contexts, context_extensions) }.merge(serialized_hash)