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

app/models/user.rb

index f9193778c80326bd19b0cb0ce875273177180c9c..50f45270a3822353891f49fa5f99e879ce1915f7 100644 (file)
@@ -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)