Fix some rubocop style issues (#5730)
This commit is contained in:
parent
2151fd3150
commit
3e90987c8b
7 changed files with 10 additions and 9 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue