I have a method:
def current_practice if session[:impersonating] Practice.find session[:impersonating] else current_user.practice end end
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
helper:all
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.
Walter