Rails uniqueness validations of nil value
When you happen to check if the attribute's value is unique before it is saved, you can use active record validation helper uniqueness.
class User < ApplicationRecord
validates :mobile_number, uniqueness: true
end
What if mobile_number is allowed ...
sinn.hashnode.dev1 min read