Its bad idea, to raise exception, if no "User" found with such id #365

wants to merge 1 commit into


None yet
3 participants

nogenhat commented Nov 2, 2012

For example, u logged, on the site, then destroy your auth model(User for simplicity),
if user try go to website, rails will render 500 error, cause find raise exception "No record found",
better user experience is just redirect to not_authenticated path.


kuboon commented Nov 5, 2012

I respect this commit 228cf83 but actually I don't know mongoid

login_from_session method don't raise exception because it is rescued.


kirs commented Oct 1, 2013

I agree with @kuboon that ActiveRecord::RecordNotFound which can be thrown from find will be rescued anyway (

kirs closed this Oct 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment