diff options
author | David Yip <yipdw@member.fsf.org> | 2017-11-16 22:52:37 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-11-16 22:52:37 -0600 |
commit | b28b405b9763a0bb3df653b51e6d084b42e9a54d (patch) | |
tree | c69f1ccb99440fea8cc94014e77687238e205160 /app/models | |
parent | ee560abdbe7a2caf0f7ac6137faf248bbaff9a93 (diff) | |
parent | dc6e031364d1f47a49ea47f20070a4e9986a4c68 (diff) |
Merge remote-tracking branch 'origin/master' into gs-master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/account_finder_concern.rb | 2 | ||||
-rw-r--r-- | app/models/web/push_subscription.rb | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 863bfaa25..230a5d298 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -117,6 +117,8 @@ class Account < ApplicationRecord :current_sign_in_at, :confirmed?, :admin?, + :moderator?, + :staff?, :locale, to: :user, prefix: true, diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb index 561c7ab9f..2e8a7fb37 100644 --- a/app/models/concerns/account_finder_concern.rb +++ b/app/models/concerns/account_finder_concern.rb @@ -44,7 +44,7 @@ module AccountFinderConcern end def with_usernames - Account.where.not(username: [nil, '']) + Account.where.not(username: '') end def matching_username diff --git a/app/models/web/push_subscription.rb b/app/models/web/push_subscription.rb index da67e7665..a41906227 100644 --- a/app/models/web/push_subscription.rb +++ b/app/models/web/push_subscription.rb @@ -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 |