##// END OF EJS Templates
Rails3: replace deprecated 'before_save' method at User model....
Toshi MARUYAMA -
r6803:507192f16758
parent child
Show More
@@ -74,6 +74,7 class User < Principal
74 validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
74 validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
75
75
76 before_create :set_mail_notification
76 before_create :set_mail_notification
77 before_save :update_hashed_password
77 before_destroy :remove_references_before_destroy
78 before_destroy :remove_references_before_destroy
78
79
79 named_scope :in_group, lambda {|group|
80 named_scope :in_group, lambda {|group|
@@ -90,7 +91,7 class User < Principal
90 true
91 true
91 end
92 end
92
93
93 def before_save
94 def update_hashed_password
94 # update hashed_password if password was set
95 # update hashed_password if password was set
95 if self.password && self.auth_source_id.blank?
96 if self.password && self.auth_source_id.blank?
96 salt_password(password)
97 salt_password(password)
General Comments 0
You need to be logged in to leave comments. Login now