Duplicate method in application_controller and application_helper

I have a method:

   def current_practice
     if session[:impersonating]
       Practice.find session[:impersonating]

It is identical in both controller and helper. How could I DRY this up so I only need maintain it in one place?

I already have the line


at the top of my ApplicationController, but when I commented out the current_practice in the controller, the one from the helper didn't step in. Maybe I'm misunderstanding what that line is meant to do.


Never mind, found helper_method. So now I have helper_method :current_practice in my ApplicationController, and it magically appears in the ApplicationHelper as well.