Sha256: 625d959dcfd99611d97d3b02b9d5732e5590a7858f501224656890cd74a7b025
Contents?: true
Size: 895 Bytes
Versions: 13
Compression:
Stored size: 895 Bytes
Contents
module Phcmemberspro class Members::Main < ActiveRecord::Base # Add Paper Trail has_paper_trail # 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: :oganization_id}, length: { minimum: 6 } validates :mphone, presence: true, uniqueness: {scope: :oganization_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
13 entries across 13 versions & 1 rubygems