Sha256: 48753034121678a56ae1c7380ff98d00ca2629e63ec761db2310e69a6a279271

Contents?: true

Size: 865 Bytes

Versions: 10

Compression:

Stored size: 865 Bytes

Contents

module Phcmemberspro
	class Members::Business < 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'
		has_many :catlists, class_name: 'Directory::Catlist'

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

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

		validates :mbcity,
			presence: true,
			length: { minimum: 3 }

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

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

		validates :mbpostalcode,
			presence: true,
			length: { minimum: 6 }
 
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
phcmemberspro-6.7.5 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.7.3 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.7.2 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.7.1 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.7.0 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.6.5 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.6.4 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.6.2 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.6.1 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.6.0 app/models/phcmemberspro/members/business.rb