Sha256: 64264ed89f3181faa30bdb2d4e45c413f94493faa3c9370e538623adfd28c8c5

Contents?: true

Size: 842 Bytes

Versions: 1

Compression:

Stored size: 842 Bytes

Contents

module Phcmembers
	class Member::Address < ApplicationRecord

		# Clean URL Initialize
		extend FriendlyId

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

		# 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

1 entries across 1 versions & 1 rubygems

Version Path
phcmembers-12.2.1 app/models/phcmembers/member/address.rb