Sha256: d4d7f4eff8ecc656cee1eda78b9a49b46c5a297d4f02d02e0f5542b85a480ec0

Contents?: true

Size: 826 Bytes

Versions: 11

Compression:

Stored size: 826 Bytes

Contents

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

		# 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

11 entries across 11 versions & 1 rubygems

Version Path
phcmemberspro-6.5.5 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.5.4 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.5.3 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.5.2 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.5.1 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.5.0 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.0.1 app/models/phcmemberspro/members/business.rb
phcmemberspro-6.0.0 app/models/phcmemberspro/members/business.rb
phcmemberspro-5.4.2 app/models/phcmemberspro/members/business.rb
phcmemberspro-5.4.1 app/models/phcmemberspro/members/business.rb
phcmemberspro-5.4.0 app/models/phcmemberspro/members/business.rb