style(rubocop): Style/NumericPredicate

This commit is contained in:
Adam Cooke
2024-02-10 22:59:30 +00:00
parent 7119e8642d
commit c558f1c69c
9 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ module HasMessage
def include_message
queued_messages = all.to_a
server_ids = queued_messages.map(&:server_id).uniq
if server_ids.size == 0
if server_ids.empty?
return []
elsif server_ids.size > 1
raise Postal::Error, "'include_message' can only be used on collections of messages from the same server"
+2 -2
View File
@@ -160,7 +160,7 @@ class Server < ApplicationRecord
total_outgoing += stat[:outgoing]
total_bounces += stat[:bounces]
end
total_outgoing == 0 ? 0 : (total_bounces / total_outgoing) * 100
total_outgoing.zero? ? 0 : (total_bounces / total_outgoing) * 100
end
end
@@ -221,7 +221,7 @@ class Server < ApplicationRecord
# Return the domain which can be used to authenticate emails sent from the given e-mail address.
#
# @param address [String] an e-mail address
#  @param address [String] an e-mail address
# @return [Domain, nil] the domain to use for authentication
def authenticated_domain_for_address(address)
return nil if address.blank?