Sha256: 54d8771e96169f1b38dafa8c2e35835d1dd278ae5e5fedb2bc913c125a1383ed
Contents?: true
Size: 852 Bytes
Versions: 1
Compression:
Stored size: 852 Bytes
Contents
module Phcmemberspro class Members::Main < ActiveRecord::Base # Gravatar include Gravtastic gravtastic :memail # Model Relationship has_many :businesses, class_name: 'Members::Business', dependent: :destroy has_many :contacts, class_name: 'Members::Contact', dependent: :destroy # Validation for Form Fields validates :mfirstname, presence: true, length: { minimum: 1 } validates :mlastname, presence: true, length: { minimum: 1 } validates :mtitle, length: { minimum: 2 } validates :memail, presence: true, uniqueness => {:scope => :user_id}, length: { minimum: 6 } validates :mphone, presence: true, uniqueness => {:scope => :user_id}, format: { with: /\A(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}\z/, message: "Please Follow this Phone Number Format: xxx-xxx-xxxx" } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
phcmemberspro-5.4.0 | app/models/phcmemberspro/members/main.rb |