Class: AdoptionContact

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActionView::Helpers::NumberHelper, CommonScopes, PublicActivity::Model
Defined in:
app/models/adoption_contact.rb

Instance Method Summary collapse

Methods included from CommonScopes

included

Instance Method Details

#formatted_phoneObject


31
32
33
# File 'app/models/adoption_contact.rb', line 31

def formatted_phone
  self.phone.blank? ? '' : number_to_phone(self.phone)
end

#modify_phone_numberObject

remove all characters from phone number except digits


27
28
29
# File 'app/models/adoption_contact.rb', line 27

def modify_phone_number
  self.phone = self.phone.delete('^0-9') unless self.phone.blank?
end