4 Validate various formats of email address against RFC 2822.
9 class PersonTest < ActiveSupport::TestCase
10 should_validate_email_format_of :email
13 class Person < ActiveRecord::Base
14 validates_email_format_of :email
21 String. A custom error message (default is: " does not appear to be a valid e-mail address")
24 Symbol. Specifies when this validation is active (default is :save, other options :create, :update)
27 Boolean. Allow nil values (default is false)
30 Boolean. Allow blank values (default is false)
33 Specifies a method, proc or string to call to determine if the validation should occur
34 (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The method,
35 proc or string should return or evaluate to a true or false value.
43 To execute the unit tests run <tt>rake test</tt>.
45 The unit tests for this plugin use an in-memory sqlite3 database.
50 * gem sources -a http://gems.github.com (only needed once)
51 * sudo gem install dancroak-validates\_email\_format\_of
56 Written by Alex Dunae (dunae.ca), 2006-07.
58 Thanks to Francis Hwang (http://fhwang.net/) at Diversion Media for creating the 1.1 update.