Sha256: 9eccbfc37d9fbac54b6b1192c7b9333f8fbd2275c0281e50bcf756221d095009

Contents?: true

Size: 848 Bytes

Versions: 46

Compression:

Stored size: 848 Bytes

Contents

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

		# Account Scope
		def self.scoped_to(account)
			where(:account_id => account.id)
		end

		# 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

46 entries across 46 versions & 1 rubygems

Version Path
phcmemberspro-3.8.0 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.7.7 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.7.6 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.7.5 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.7.0 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.6.5 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.6.1 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.6.0 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.5.9 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.5.6 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.5.5 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.5.2 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.5.1 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.5.0 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.3.3 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.3.2 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.3.1 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.3.0 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.2.0 app/models/phcmemberspro/members/main.rb
phcmemberspro-3.1.1 app/models/phcmemberspro/members/main.rb