Sha256: db7b640b36af07d94f8cec031fc17d2977f22a46318a4ec6da65c8c6657d57ad

Contents?: true

Size: 1.17 KB

Versions: 64

Compression:

Stored size: 1.17 KB

Contents

module Phcmembers
	class Member::Profile < ApplicationRecord

		# Clean URL Initialize
		extend FriendlyId

		# Add Paper Trail
		has_paper_trail :class_name => 'Phcmembers::ProfileVersions'

		# Gravatar
		include Gravtastic
			gravtastic :memail

		# Model Relationships
		has_many :addresses, class_name: 'Phcmembers::Member::Address'
		has_many :listings, class_name: 'Phcmembers::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 },
			format: { with: /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/, message: "Please follow this Email format: *****@********.***" }

		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: ***-***-****" }

		# Clean URL Define
		friendly_id :phcmembers_profiles_slug, use: [:slugged, :finders]

		# Define for Multiple Records
		def phcmembers_profiles_slug
			[
				[:mfirstname, :mlastname]
			]
		end

	end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
phcmembers-27.0.0 app/models/phcmembers/member/profile.rb
phcmembers-26.0.0 app/models/phcmembers/member/profile.rb
phcmembers-25.0.0 app/models/phcmembers/member/profile.rb
phcmembers-24.0.0 app/models/phcmembers/member/profile.rb
phcmembers-23.0.0 app/models/phcmembers/member/profile.rb
phcmembers-22.0.0 app/models/phcmembers/member/profile.rb
phcmembers-21.1.0 app/models/phcmembers/member/profile.rb
phcmembers-21.0.1 app/models/phcmembers/member/profile.rb
phcmembers-21.0.0 app/models/phcmembers/member/profile.rb
phcmembers-19.2.0 app/models/phcmembers/member/profile.rb
phcmembers-19.1.0 app/models/phcmembers/member/profile.rb
phcmembers-19.0.0 app/models/phcmembers/member/profile.rb
phcmembers-18.0.0 app/models/phcmembers/member/profile.rb
phcmembers-17.1.0 app/models/phcmembers/member/profile.rb
phcmembers-17.0.1 app/models/phcmembers/member/profile.rb
phcmembers-16.2.0 app/models/phcmembers/member/profile.rb
phcmembers-16.1.0 app/models/phcmembers/member/profile.rb
phcmembers-16.0.2 app/models/phcmembers/member/profile.rb
phcmembers-16.0.1 app/models/phcmembers/member/profile.rb
phcmembers-16.0.0 app/models/phcmembers/member/profile.rb