From 1579f3b45db4b5717984174689c41b1e7f679d1b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 16 Dec 2004 01:32:35 +0000 Subject: Added Base.validates_format_of that Validates whether the value of the specified attribute is of the correct form by matching it against the regular expression provided. [Marcel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/CHANGELOG | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index b1f20d4806..844dc20b9b 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -32,7 +32,14 @@ errors.on(:name) # => "must be shorter" errors.on("name") # => "must be shorter" -* Added Base.validates_boundries_of that delegates to add_on_boundary_breaking #312 [Tobias Luetke]. Example: +* Added Base.validates_format_of that Validates whether the value of the specified attribute is of the correct form by matching + it against the regular expression provided. [Marcel] + + class Person < ActiveRecord::Base + validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/, :on => :create + end + +* Added Base.validates_boundaries_of that delegates to add_on_boundary_breaking #312 [Tobias Luetke]. Example: class Person < ActiveRecord::Base validates_boundries_of :password, :password_confirmation -- cgit v1.2.3