Sha256: c0462279716575e355725573b88050242e0ed9a3e6158a92ff3be036fb7eaac7

Contents?: true

Size: 1.12 KB

Versions: 57

Compression:

Stored size: 1.12 KB

Contents

module Phcmemberspro
  class Member::Address < ApplicationRecord

		# Clean URL Initialize
		extend FriendlyId

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

		# Model Relationships
    belongs_to :profile, class_name: 'Phcmemberspro::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 :phcmemberspro_address_slug, use: [:slugged, :finders]

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

		def country_name
	    country = ISO3166::Country[country_code]
	    country.translations[I18n.locale.to_s] || country.mccountry
	  end

  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
phcmemberspro-76.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-74.1.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-74.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-73.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-72.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-71.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-70.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-69.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-68.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-67.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-66.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-65.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-64.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-63.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-62.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-61.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-60.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-59.0.1 app/models/phcmemberspro/member/address.rb
phcmemberspro-59.0.0 app/models/phcmemberspro/member/address.rb
phcmemberspro-58.0.0 app/models/phcmemberspro/member/address.rb