module C80Callback class Cmessage < ActiveRecord::Base validates :name, presence: true, length: { in: 1..30 } validates :mobile, presence: true, length: { in: 1..30 } validates_format_of :mobile, :with => /\A^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$\Z/i # validates_with CmessageValidator end end