about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb2
-rw-r--r--app/models/concerns/account_finder_concern.rb2
-rw-r--r--app/models/web/push_subscription.rb4
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