actmd/abraham

Where to specify current_user ?

netpenthe opened this issue · 1 comments

I use a different table for Devise.

Where do I configure this?

Hello @netpenthe. There are several different ways that you can do this, but the simplest is to just define an alias method.

alias_method 'current_user`, `current_foo`

where current_foo is the method that is available to you via Devise. You'll want to change that to whatever your actual function is. I'm not sure how you have setup your Rails project, but you can add this to your ApplicationController or whatever base class you use for authenticated controllers.

Alternatively, you can just define a method called current_user that calls your Devise method. E.g.

def current_user
  current_foo
end

Again, here we're assuming that current_foo is the name of the function Devise provides.

Hope that helps!