I\'m working on a Rails 3.2 app where I use Devise for authentication. I decided to try single table inheritance for managing user roles, but I quickly ran into a problem. I cur
Not sure if this is still needed a solution to this...
A more elegant way to have the double authentications could be to do the following:
private
def authenticate!
:authenticate_admin! || :authenticate_collaborator!
@current_user = admin_signed_in? ? current_admin : current_collaborator
end
Then call before_filter :authenticate!
If you dont need a universal '@current_user' variable just leave out the second line.
Hope this helps.