]> source.dussan.org Git - redmine.git/commitdiff
Rails3: model: replace deprecated 'validate' method at User model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 06:14:11 +0000 (06:14 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 06:14:11 +0000 (06:14 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7431 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index 50f45270a3822353891f49fa5f99e879ce1915f7..b3622024e6bd431c0d400d660858281a985d94d1 100644 (file)
@@ -72,6 +72,7 @@ class User < Principal
   validates_length_of :mail, :maximum => 60, :allow_nil => true
   validates_confirmation_of :password, :allow_nil => true
   validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
+  validate :validate_password_length
 
   before_create :set_mail_notification
   before_save   :update_hashed_password
@@ -546,7 +547,7 @@ class User < Principal
 
   protected
 
-  def validate
+  def validate_password_length
     # Password length validation based on setting
     if !password.nil? && password.size < Setting.password_min_length.to_i
       errors.add(:password, :too_short, :count => Setting.password_min_length.to_i)