Sha256: 7b836b50de5850aa527435dccff98b71797e7a2ee0e5addf400f908236086678
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
module Phcmemberspro class Member::Profile < ApplicationRecord # Clean URL Initialize extend FriendlyId # 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" } # Clean URL Define friendly_id :phcmembers_profiles_slug, use: [:slugged, :finders] # Define for Multiple Records def phcmembers_profiles_slug [ [:id, :mfirstname, :mlastname] ] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
phcmemberspro-20.5.1 | app/models/phcmemberspro/member/profile.rb |