Sha256: 8ac7d4ec5a991e3ec2e06a9e4dfc9e3f69e98535825ef3e7e3675127aeafcaaf

Contents?: true

Size: 887 Bytes

Versions: 3

Compression:

Stored size: 887 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

3 entries across 3 versions & 1 rubygems

Version Path
phcmembers-12.1.1 app/models/phcmembers/member/address.rb
phcmembers-12.1.0 app/models/phcmembers/member/address.rb
phcmembers-12.0.1 app/models/phcmembers/member/address.rb