Sha256: 9eccbfc37d9fbac54b6b1192c7b9333f8fbd2275c0281e50bcf756221d095009
Contents?: true
Size: 848 Bytes
Versions: 46
Compression:
Stored size: 848 Bytes
Contents
module Phcmemberspro class Members::Main < ActiveRecord::Base # Account Scope def self.scoped_to(account) where(:account_id => account.id) end # Model Relationship has_many :listings, class_name: 'Members::Listing', 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: true, length: { minimum: 6 } validates :mphone, presence: true, uniqueness: true, 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
46 entries across 46 versions & 1 rubygems