How can I configure my RubyMine with devise gem?

Even though it's obvious, you can put

def current_user
  super
end

to your ApplicationController at least to avoid undefined method warning in all controllers. I had no success telling RubyMine to autocomplete using YARD:

# @return [User]
def current_user
  super
end

Update: P.S. It is good idea to let other developers know about the reason why this method is needed, if used without YARD comment. Otherwise it will be removed or at least questioned by others.

Update 2019-02-26: Code navigation works at least in 2018.3.4 thanks to YARD comment


Short answer:
You're not doing anything wrong. Right now, it's the best Rubymine can do.

Slightly longer answer:
As you probably know, Ruby can be a very dynamic language. Devise relies heavily on the metaprogramming capabilities of the language. The helpers, such as current_user are generated at runtime, rendering Rubymine's static analysis capabilities ineffective.

Rubymine would need to have special support for Devise and, as far as I know, it just doesn't.