Sha256: 4f974e9d3ff54bde9bc80de1c3d0c4860ed884ba924b7ee24d281c7575472c56

Contents?: true

Size: 886 Bytes

Versions: 10

Compression:

Stored size: 886 Bytes

Contents

module Phcmemberspro
  class Member::Profile < ApplicationRecord
  
    # Add Paper Trail
    has_paper_trail
    
    # Gravatar
    include Gravtastic
    gravtastic :memail
    
    # Model Relationship
    has_many :addresses, class_name: 'Phcmemberspro::Member::Address'
    has_many :listings, class_name: 'Phcmemberspro::Member::Listing'
    
    # 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,
      length: { minimum: 6 }
    
    validates :mphone,
      presence: 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

10 entries across 10 versions & 1 rubygems

Version Path
phcmemberspro-17.1.4 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.1.3 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.1.2 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.1.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.1.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.0.3 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.0.2 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.0.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-17.0.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-16.0.2 app/models/phcmemberspro/member/profile.rb