Adding current_user to ApplicationController for IDE detection breaks impersonate_user
sjieg opened this issue · 2 comments
sjieg commented
Hey, first of all, thanks for this gem. We've been using it succesfully for almost 2 years now without fail.
I don't think this is a bug of Pretender really, but maybe you can help me. RubyMine doesn't understand current_user
when using Devise, so I've put a function placement in my ApplicationController according to this solution:
class ApplicationController < ActionController::Base
# @return [User]
def current_user
super
end
end
When using this, all the red squiggly lines disappear and the IDE understands it's working with a User, making suggestions better. Unfortunately the impersonate_user
function stops working because of this.
I've had a look at your code and my guess would be that I'm overwriting your define_method impersonated_method
. WDYT?