Skip to content

Commit 832eb30

Browse files
Gargronhiyuki2578
authored andcommitted
Fix alerts booleans not being typecast correctly in push subscription (mastodon#11343)
* Fix `alerts` booleans not being typecast correctly in push subscription Fix mastodon#10789 * Fix typo
1 parent a6c844a commit 832eb30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/serializers/rest/web_push_subscription_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class REST::WebPushSubscriptionSerializer < ActiveModel::Serializer
44
attributes :id, :endpoint, :alerts, :server_key
55

66
def alerts
7-
object.data&.dig('alerts') || {}
7+
(object.data&.dig('alerts') || {}).each_with_object({}) { |(k, v), h| h[k] = ActiveModel::Type::Boolean.new.cast(v) }
88
end
99

1010
def server_key

0 commit comments

Comments
 (0)