From 507192f167580e6619de16d05d50ef4362d3e398 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 31 Aug 2011 16:06:36 +0000 Subject: [PATCH] Rails3: replace deprecated 'before_save' method at User model. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6923 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index f9193778c..50f45270a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -74,6 +74,7 @@ class User < Principal validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true before_create :set_mail_notification + before_save :update_hashed_password before_destroy :remove_references_before_destroy named_scope :in_group, lambda {|group| @@ -90,7 +91,7 @@ class User < Principal true end - def before_save + def update_hashed_password # update hashed_password if password was set if self.password && self.auth_source_id.blank? salt_password(password)