Changeset 340

Show
Ignore:
Timestamp:
04/05/06 10:12:33 (3 years ago)
Author:
snowblink
Message:

Ticket #89 User creation halts the after_save callback chain.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • login_engine/branches/rb_1.0/lib/login_engine/authenticated_user.rb

    r282 r340  
    2828        attr_accessor :password, :password_confirmation 
    2929       
    30         after_save '@new_password = false' 
     30        after_save :falsify_new_password 
    3131        after_validation :crypt_password 
    32        
     32 
    3333      end 
    3434      base.extend(ClassMethods) 
     
    130130    end 
    131131 
     132    def falsify_new_password 
     133      @new_password = false 
     134      true 
     135    end 
     136 
    132137    def new_security_token(hours = nil) 
    133138      write_attribute('security_token', AuthenticatedUser.hashed(self.salted_password + Time.now.to_i.to_s + rand.to_s))