Add and apply Rails/WhereNot rubocop rule

We simplify the code a little bit, and make it more consistent since we
were already using `where.not` in most places.
This commit is contained in:
Javi Martín
2021-08-09 23:07:14 +02:00
parent 69dda19af7
commit 8ae138aa19
7 changed files with 12 additions and 10 deletions

View File

@@ -2,7 +2,7 @@ class Verification::Management::ManagedUser
include ActiveModel::Model
def self.find(document_type, document_number)
User.where("document_number is not null").
User.where.not(document_number: nil).
find_or_initialize_by(document_type: document_type,
document_number: document_number)
end