Fix Style/HashTransformValues cop (#34416)

This commit is contained in:
Matt Jankowski 2025-04-11 04:09:40 -04:00 committed by GitHub
parent 1d7b45093d
commit e753776930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View file

@ -6,7 +6,7 @@ class REST::WebPushSubscriptionSerializer < ActiveModel::Serializer
delegate :standard, to: :object
def alerts
(object.data&.dig('alerts') || {}).each_with_object({}) { |(k, v), h| h[k] = ActiveModel::Type::Boolean.new.cast(v) }
(object.data&.dig('alerts') || {}).transform_values { |v| ActiveModel::Type::Boolean.new.cast(v) }
end
def server_key