Merge remote-tracking branch 'origin/master' into gs-master
This commit is contained in:
@ -117,6 +117,8 @@ class Account < ApplicationRecord
|
||||
:current_sign_in_at,
|
||||
:confirmed?,
|
||||
:admin?,
|
||||
:moderator?,
|
||||
:staff?,
|
||||
:locale,
|
||||
to: :user,
|
||||
prefix: true,
|
||||
|
@ -44,7 +44,7 @@ module AccountFinderConcern
|
||||
end
|
||||
|
||||
def with_usernames
|
||||
Account.where.not(username: [nil, ''])
|
||||
Account.where.not(username: '')
|
||||
end
|
||||
|
||||
def matching_username
|
||||
|
@ -24,12 +24,12 @@ class Web::PushSubscription < ApplicationRecord
|
||||
end
|
||||
|
||||
def pushable?(notification)
|
||||
data && data.key?('alerts') && data['alerts'][notification.type.to_s]
|
||||
data&.key?('alerts') && data['alerts'][notification.type.to_s]
|
||||
end
|
||||
|
||||
def as_payload
|
||||
payload = { id: id, endpoint: endpoint }
|
||||
payload[:alerts] = data['alerts'] if data && data.key?('alerts')
|
||||
payload[:alerts] = data['alerts'] if data&.key?('alerts')
|
||||
payload
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user