Module: ValidatesAndFormatsPhones::InstanceMethods
- Defined in:
- lib/validates_and_formats_phones/validates_and_formats_phones.rb
Instance Method Summary collapse
Instance Method Details
#format_phone_field(field_name, formats = []) ⇒ Object
49 50 51 52 |
# File 'lib/validates_and_formats_phones/validates_and_formats_phones.rb', line 49 def format_phone_field(field_name, formats = []) formats << DEFAULT_FORMAT if formats.empty? self.send("#{field_name}=", self.send(field_name).to_s.to_phone(formats)) unless send(field_name).blank? end |