Thank you for response. First of all - it seems I will still have problem with checking current_user.pass_expires inside application_controller.
Secondly - Isn't it that "reset_password" transition will ensure me, that it will be called only when password is changed? On the other hand, I should check with before filter if new password is diffrent from the old one. On 5 Kwi, 00:02, kevinpfromnm <[email protected]> wrote: > Ok, I'm pretty sure this isn't what you're after: > > transition :reset_password, { :active => :active }, :available_to => > :key_holder, > :params => [ :password, :password_confirmation ] do > after_save :reincarnate_pass > puts "barszcz z grzybami" > end > > Your after_save definition should be external to any method or block or > you'll get unpredictable results. Change this spot to be just > reincarnate_pass (not the symbol, call the method). > > Next, your after_save method, needs to check if the password changed, unless > the only time the user is saved is on password change but I wouldn't > normally make that assumption as it's quite easy to break. In other words, > your existing reincarnate_pass method won't work for your after_save check. > > Also, probably should be a before_save instead of after_save. My bad. -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
