Sha256: e0b1e0d77599695c9e728c649c0b8ff1e4ed265d03534a252096f99e7da64e3a
Contents?: true
Size: 862 Bytes
Versions: 14
Compression:
Stored size: 862 Bytes
Contents
module Phcmemberspro class Members::Business < 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 :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
14 entries across 14 versions & 1 rubygems