Sha256: 2e3009a9855954511551ddaeb7de8791d023e049a4ba46460ff375edc25d6a8f

Contents?: true

Size: 712 Bytes

Versions: 28

Compression:

Stored size: 712 Bytes

Contents

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

		# Account Scope
		def self.scoped_to(account)
			where(:account_id => account.id)
		end

		# 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

28 entries across 28 versions & 1 rubygems

Version Path
phcmemberspro-5.3.9 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.8 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.7 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.6 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.5 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.4 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.2 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.3.1 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.7 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.6 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.5 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.4 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.3 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.2 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.1 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.2.0 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.1.5 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.1.4 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.1.3 app/models/phcmemberspro/members/contact.rb
phcmemberspro-5.1.2 app/models/phcmemberspro/members/contact.rb