oivoodoo/devise_masquerade — pull request #14 by gorkunov (2014-09-10 09:54:16+00:00)
Title: Fix `RuntimeError: Could not find a valid mapping for nil`

Steps to reproduce the bug:

1. Open two pages under masqueraded user
2. Turn off (back) masquerading on the first page
3. Try to turn off masquerading on the second page

After that you will see `RuntimeError: Could not find a valid mapping for nil` because user id from session is nil.