Sha256: e10f8ed8c67b3915c3f6ea9ad8f93ffdc61ba56bfcd0feeffb0b037357e704ab

Contents?: true

Size: 657 Bytes

Versions: 2

Compression:

Stored size: 657 Bytes

Contents

module Phcmembers
	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

2 entries across 2 versions & 1 rubygems

Version Path
phcmembers-3.0.1 app/models/phcmembers/members/contact.rb
phcmembers-3.0.0 app/models/phcmembers/members/contact.rb