mirror of
https://github.com/redmine/redmine.git
synced 2024-09-13 15:45:44 +02:00
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
This commit is contained in:
parent
ac9d581970
commit
507192f167
@ -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…
Reference in New Issue
Block a user