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 ...
A web developer in Ruby on Rails and React
My personal blog about software development and other topics.
Markdown supported · ⌘↵ to post
No responses yet.