Sha256: b3459340ace1dae4c71f88b35bdf838d3a4c6f8c6b234638a2d994fe1c65fc3a

Contents?: true

Size: 887 Bytes

Versions: 20

Compression:

Stored size: 887 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

20 entries across 20 versions & 1 rubygems

Version Path
phcmemberspro-16.0.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-16.0.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-15.1.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-15.1.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-15.0.3 app/models/phcmemberspro/member/profile.rb
phcmemberspro-15.0.2 app/models/phcmemberspro/member/profile.rb
phcmemberspro-15.0.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-15.0.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.7 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.5 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.4 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.3 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.2 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.7.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.6.3 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.6.2 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.6.1 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.6.0 app/models/phcmemberspro/member/profile.rb
phcmemberspro-14.5.0 app/models/phcmemberspro/member/profile.rb