Sha256: 089dd2a4acb0791da40ba456a8391b9c62e01c28578980c5de9ff041de8b3591
Contents?: true
Size: 860 Bytes
Versions: 91
Compression:
Stored size: 860 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 :mccontactname, presence: true, length: { minimum: 3 } validates :mccompanyname, presence: true, length: { minimum: 2 } 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
91 entries across 91 versions & 1 rubygems