diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-21 06:14:11 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-21 06:14:11 +0000 |
commit | 7e017e6c2cc5fe5cef55b564d37f67f302d3db1b (patch) | |
tree | f11314d2d261c46c7d3e9b70130a6be4d09dee97 /app | |
parent | 80581538a16406855f1c0fcff637b5f9cde2d2d6 (diff) | |
download | redmine-7e017e6c2cc5fe5cef55b564d37f67f302d3db1b.tar.gz redmine-7e017e6c2cc5fe5cef55b564d37f67f302d3db1b.zip |
Rails3: model: replace deprecated 'validate' method at User model
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7431 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 50f45270a..b3622024e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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) |