public
Description: A Family Budget application
Clone URL: git://github.com/francois/family_budget.git
If the person doesn't exist in the DB anymore, don't complain and simply 
do as if we had no person in the session.
francois (author)
Thu Feb 28 12:41:43 -0800 2008
commit  6764bd818d2de348ce2d4adb30b418667927f698
tree    98de41352237f817606e29895d20dd1ae446b9ae
parent  8255f82e5af83e6092148264dd28a6fa58d3cb45
...
94
95
96
97
 
 
 
 
 
 
98
99
100
...
94
95
96
 
97
98
99
100
101
102
103
104
105
0
@@ -94,7 +94,12 @@ module AuthenticatedSystem
0
 
0
     # Called from #current_person. First attempt to login by the person id stored in the session.
0
     def login_from_session
0
- self.current_person = Person.find(session[:person_id], :include => :family) if session[:person_id]
0
+ begin
0
+ self.current_person = Person.find(session[:person_id], :include => :family) if session[:person_id]
0
+ rescue ActiveRecord::RecordNotFound
0
+ session[:person_id] = nil
0
+ nil
0
+ end
0
     end
0
 
0
     # Called from #current_person. Now, attempt to login by basic authentication information.

Comments

    No one has commented yet.