Files
grecia/app/models/verification/management/managed_user.rb
Javi Martín 8ae138aa19 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.
2021-08-09 23:52:47 +02:00

10 lines
292 B
Ruby

class Verification::Management::ManagedUser
include ActiveModel::Model
def self.find(document_type, document_number)
User.where.not(document_number: nil).
find_or_initialize_by(document_type: document_type,
document_number: document_number)
end
end