Send :scope to the proper validation.

This commit is contained in:
José Valim 2009-12-16 01:28:43 +01:00
parent 01ca3e54f8
commit 436300928b
2 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,6 @@
* bug fix
* Give scope to the proper model validation
* enhancements
* Do not care about blank passwords on update
* Mail views are scoped as well

View File

@ -19,9 +19,8 @@ module Devise
base.class_eval do
validates_presence_of :email
validates_uniqueness_of :email, :allow_blank => true
validates_format_of :email, :with => EMAIL_REGEX, :allow_blank => true,
:scope => authentication_keys[1..-1]
validates_uniqueness_of :email, :scope => authentication_keys[1..-1], :allow_blank => true
validates_format_of :email, :with => EMAIL_REGEX, :allow_blank => true
with_options :if => :password_required? do |v|
v.validates_presence_of :password