Skip to content

Commit

Permalink
Rails3: replace deprecated 'before_save' method at User model.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6923 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
marutosi committed Aug 31, 2011
1 parent ac9d581 commit 507192f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -90,7 +91,7 @@ def set_mail_notification
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)
Expand Down

0 comments on commit 507192f

Please sign in to comment.