ActsAsPhone

A simple plugin which currently just attaches a validation and setter method for each attribute argument passed to it.

Example

acts_as_phone :phone

#=> does validates_format_of :phone, :with => /^d10$/

#=> and adds def phone=(value); write_attribute(:phone, value.to_s.gsub(/D+/, ”)); end


Copyright © 2009 Dallas Reedy, released under the MIT license