I have added another login filled in devise, i.e. contact_no. Either email address or contact no. should provided. To make contact_no unique I added a check in my user model for uniquness.
validates_uniqueness_of :contact_no, allow_nil: true, allow_blank: true
But, it keeps throwing error
Mysql2::Error: Duplicate entry '' for key 'index_users_on_contact_no':