about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 81b724935..90434f975 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 class Account < ApplicationRecord
   include Targetable
   include PgSearch
@@ -92,11 +94,11 @@ class Account < ApplicationRecord
   end
 
   def favourited?(status)
-    (status.reblog? ? status.reblog : status).favourites.where(account: self).count > 0
+    (status.reblog? ? status.reblog : status).favourites.where(account: self).count.positive?
   end
 
   def reblogged?(status)
-    (status.reblog? ? status.reblog : status).reblogs.where(account: self).count > 0
+    (status.reblog? ? status.reblog : status).reblogs.where(account: self).count.positive?
   end
 
   def keypair
@@ -115,8 +117,8 @@ class Account < ApplicationRecord
   def avatar_remote_url=(url)
     self.avatar = URI.parse(url) unless self[:avatar_remote_url] == url
     self[:avatar_remote_url] = url
-  rescue OpenURI::HTTPError
-    #
+  rescue OpenURI::HTTPError => e
+    Rails.logger.debug "Error fetching remote avatar: #{e}"
   end
 
   def object_type