Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Send :scope to the proper validation.

  • Loading branch information...
commit 436300928b75668d3dfcef58850a2492ad06acd4 1 parent 01ca3e5
@josevalim josevalim authored
Showing with 5 additions and 3 deletions.
  1. +3 −0  CHANGELOG.rdoc
  2. +2 −3 lib/devise/models/validatable.rb
View
3  CHANGELOG.rdoc
@@ -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
5 lib/devise/models/validatable.rb
@@ -19,9 +19,8 @@ def self.included(base)
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
Please sign in to comment.
Something went wrong with that request. Please try again.