Update validates_formatting_of dependency to version 0.4.0

Add validation for phone numbers.
This commit is contained in:
Erik Michaels-Ober 2012-01-02 11:37:57 -08:00
parent ae805e9163
commit 0cd8307c36
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
GIT
remote: git://github.com/sferik/rails_admin.git
revision: 086cfed1481bd9551262cbd4814a7fc260985cad
revision: 4e3014605b734f28942db836a2fc78692af05b10
specs:
rails_admin (0.0.1)
bbenezech-nested_form (~> 0.0)
@ -164,7 +164,7 @@ GEM
uglifier (1.2.1)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
validates_formatting_of (0.3.7)
validates_formatting_of (0.4.0)
rails (~> 3.0)
warden (1.1.0)
rack (>= 1.0)

View File

@ -5,6 +5,8 @@ class User < ActiveRecord::Base
:password, :password_confirmation, :remember_me, :sms_number, :state,
:voice_number, :zip
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
validates_formatting_of :sms_number, :using => :us_phone, :allow_blank => true
validates_formatting_of :voice_number, :using => :us_phone, :allow_blank => true
validates_formatting_of :zip, :using => :us_zip, :allow_blank => true
validates_presence_of :name
has_many :reminders_to, :class_name => "Reminder", :foreign_key => "to_user_id"