Fix Style/HashTransformValues
cop (#34416)
This commit is contained in:
parent
1d7b45093d
commit
e753776930
2 changed files with 2 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue