From: Tomas Sedovic <[email protected]>

Updating a user's password now fails when only one of the
password/confirmation fields is filled in.
---
 src/app/models/user.rb |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/app/models/user.rb b/src/app/models/user.rb
index fe429bd..aff5f98 100644
--- a/src/app/models/user.rb
+++ b/src/app/models/user.rb
@@ -27,4 +27,9 @@ class User < ActiveRecord::Base
 
   belongs_to :quota, :autosave => true
   accepts_nested_attributes_for :quota
+
+  # authlogic's password confirmation doesn't fire up when we fill in the
+  # confirmation field but leave the password field blank. We have to check
+  # that manually:
+  validates_confirmation_of :password, :if => "password.blank? and 
!password_confirmation.blank?"
 end
-- 
1.7.2.3

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to