mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Send :scope to the proper validation.
This commit is contained in:
parent
01ca3e54f8
commit
436300928b
2 changed files with 5 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
* bug fix
|
||||||
|
* Give scope to the proper model validation
|
||||||
|
|
||||||
* enhancements
|
* enhancements
|
||||||
* Do not care about blank passwords on update
|
* Do not care about blank passwords on update
|
||||||
* Mail views are scoped as well
|
* Mail views are scoped as well
|
||||||
|
|
|
@ -19,9 +19,8 @@ module Devise
|
||||||
|
|
||||||
base.class_eval do
|
base.class_eval do
|
||||||
validates_presence_of :email
|
validates_presence_of :email
|
||||||
validates_uniqueness_of :email, :allow_blank => true
|
validates_uniqueness_of :email, :scope => authentication_keys[1..-1], :allow_blank => true
|
||||||
validates_format_of :email, :with => EMAIL_REGEX, :allow_blank => true,
|
validates_format_of :email, :with => EMAIL_REGEX, :allow_blank => true
|
||||||
:scope => authentication_keys[1..-1]
|
|
||||||
|
|
||||||
with_options :if => :password_required? do |v|
|
with_options :if => :password_required? do |v|
|
||||||
v.validates_presence_of :password
|
v.validates_presence_of :password
|
||||||
|
|
Loading…
Reference in a new issue