Sha256: fa72ba7550a59eeee7e62dbad94300b939df4b35ac235e4b8313b592b2fea35d
Contents?: true
Size: 907 Bytes
Versions: 28
Compression:
Stored size: 907 Bytes
Contents
module Phcmemberspro class Members::Main < ActiveRecord::Base # Gravatar include Gravtastic gravtastic :memail # Account Scope def self.scoped_to(account) where(:account_id => account.id) end # 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: 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
28 entries across 28 versions & 1 rubygems