Sha256: 1774b54321a5d27c1e6db62e68397fda0f1442b0c8b7515635b1387cb65b1f0f

Contents?: true

Size: 660 Bytes

Versions: 76

Compression:

Stored size: 660 Bytes

Contents

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

		# Add Paper Trail
		has_paper_trail

		# Translate Country Code to Name
		def country_name
			country = ISO3166::Country[mccountry]
			country.translations[I18n.locale.to_s] || country.name
		end

		# Model Relationships
		belongs_to :main, class_name: 'Members::Main'

		# Validation for Form Fields
		validates :mccity,
			presence: true,
			length: { minimum: 3 }

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

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

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

	end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
phcmemberspro-7.8.11 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.10 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.8 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.7 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.6 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.5 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.2 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.1 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.8.0 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.7.0 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.6.0 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.5.7 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.5.6 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.5.5 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.5.2 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.5.1 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.5.0 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.1.2 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.1.1 app/models/phcmemberspro/members/contact.rb
phcmemberspro-7.1.0 app/models/phcmemberspro/members/contact.rb