Browse Source

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
tags/1.3.0
Toshi MARUYAMA 12 years ago
parent
commit
507192f167
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      app/models/user.rb

+ 2
- 1
app/models/user.rb View 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)

Loading…
Cancel
Save