views:

20

answers:

1

How can I add :includes => :account to the current_user finder method in devise ?

Thanks

A: 

You could do something like this:

class User < ActiveRecord::Base
  devise :your, :devise, :modules
  default_scope :includes => :account
end

that will always include the account if you load the user.

jigfox
Yes, but that would be for all purposes of User, not only devise ;) Anyway, that's a start, thanks
Gravis
I know, but right now I have no idea how do this only for the current_user. But are there a lot of situation where you don't need the included account?
jigfox
Yes, indedd, there are situations. But I'll use that until I find a better solution ;) thanks
Gravis