Sha256: 9cba7e1a12de4a48c911003e6b38444d87a869952a072eb7a62efea8f83b3e1f

Contents?: true

Size: 932 Bytes

Versions: 2

Compression:

Stored size: 932 Bytes

Contents

module Phcmembers
	class Member::Address < ApplicationRecord

		# Clean URL Initialize
		extend FriendlyId

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

		# Model Relationships
		belongs_to :profile, class_name: 'Phcmembers::Member::Profile'

		# Validation for Form Fields
		validates :mcaddressl1,
		presence: true,
		length: { minimum: 2 }

		validates :mccity,
		length: { minimum: 3 }

		validates :mcprovince,
		presence: true,
		length: { minimum: 2 }

		validates :mccountry,
		presence: true,
		length: { minimum: 2 }

		validates :mcpostalcode,
		presence: true,
		length: { minimum: 3 }

		validates :mctype,
		presence: true,
		length: { minimum: 2 }

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

    # Define for Multiple Records
    def phcmembers_address_slug
    [
      [:mcaddressl1, :mccity, :mcprovince]
    ]
    end

	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phcmembers-13.0.0 app/models/phcmembers/member/address.rb
phcmembers-12.5.0 app/models/phcmembers/member/address.rb