Sha256: 8e0b23308ca9f4be9c7adf0b2ec505d118f42d0558aa71d739ed17f7d66e75a8

Contents?: true

Size: 754 Bytes

Versions: 17

Compression:

Stored size: 754 Bytes

Contents

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

		# 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

17 entries across 17 versions & 1 rubygems

Version Path
phcmembers-2.0.0 app/models/phcmembers/members/main.rb
phcmembers-1.9.9 app/models/phcmembers/members/main.rb
phcmembers-1.9.5 app/models/phcmembers/members/main.rb
phcmembers-1.9.0 app/models/phcmembers/members/main.rb
phcmembers-1.8.1 app/models/phcmembers/members/main.rb
phcmembers-1.8.0 app/models/phcmembers/members/main.rb
phcmembers-1.7.8 app/models/phcmembers/members/main.rb
phcmembers-1.7.6 app/models/phcmembers/members/main.rb
phcmembers-1.7.5 app/models/phcmembers/members/main.rb
phcmembers-1.7.0 app/models/phcmembers/members/main.rb
phcmembers-1.6.0 app/models/phcmembers/members/main.rb
phcmembers-1.5.0 app/models/phcmembers/members/main.rb
phcmembers-1.0.2 app/models/phcmembers/members/main.rb
phcmembers-1.0.1 app/models/phcmembers/members/main.rb
phcmembers-1.0.0 app/models/phcmembers/members/main.rb
phcmembers-0.9.8 app/models/phcmembers/members/main.rb
phcmembers-0.9.7 app/models/phcmembers/members/main.rb