app/models/phcmemberspro/members/contact.rb in phcmemberspro-3.0.0 vs app/models/phcmemberspro/members/contact.rb in phcmemberspro-3.0.1
- old
+ new
@@ -5,16 +5,17 @@
def self.scoped_to(account)
where(:account_id => account.id)
end
# Translate Country Code to Name
- def members_contact
+ def contact_country_name
country = ISO3166::Country[mccountry]
country.translations[I18n.locale.to_s] || country.name
end
# Model Relationships
belongs_to :main, class_name: 'Members::Main'
+ before_create :contact_country_name
# Validation for Form Fields
validates :mccontactname,
presence: true,
length: { minimum: 3 }