Sha256: e3460055c55c2f8d3b94b7a7cca5cd7af51abc21ff8ab11faf3eaa7f1e344b3f

Contents?: true

Size: 831 Bytes

Versions: 4

Compression:

Stored size: 831 Bytes

Contents

module Phcmemberspro
	class Members::Main < ActiveRecord::Base

		# Mount PHCEngine
		belongs_to :user, :class_name => "Phcengine::User"

		# Model Relationship
		has_many :listings, class_name: 'Members::Listing', 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

4 entries across 4 versions & 1 rubygems

Version Path
phcmemberspro-1.6.5 app/models/phcmemberspro/members/main.rb
phcmemberspro-1.6.3 app/models/phcmemberspro/members/main.rb
phcmemberspro-1.6.1 app/models/phcmemberspro/members/main.rb
phcmemberspro-1.6.0 app/models/phcmemberspro/members/main.rb