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