My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 59 attachment: validate_users_password.patch (1.1 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Index: /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/user.rb
===================================================================
--- /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/user.rb (revision 43)
+++ /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/user.rb (working copy)
@@ -10,17 +10,11 @@
validates_uniqueness_of :login, :on => :create
validates_length_of :login, :within => 3..40
validates_presence_of :login
-
- def validate
- if (5 > self.password.length && 40 < self.password.length)
- errors.add(:password, "Password must be between 5 and 40 characters.")
- end
-
- # check presence of password & matching if they both aren't blank
- if (self.password != self.password_confirmation) then
- errors.add(:password, "Password and Confirmation don't match.")
- end
- end
+
+ validates_presence_of :password
+ validates_length_of :password, :within => 5..40
+ validates_confirmation_of :password
+

@@salt = '20ac4d290c2293702c64b3b287ae5ea79b26a5c1'
cattr_accessor :salt

Powered by Google Project Hosting