Closed Trevoke closed 10 years ago
I'm not sure about such a feature. Maybe because I'm personally against using domain name for user class (I prefer having User
class for login, session etc. and SoccerFan
or sth else for profile information). Anyway, I think we could merge it if someone implements it, but it must be defined as an alias for current_user
- internally we should still use current_user
.
On the other hand, you need just one line of code to do it in your app:
class ApplicationController < ActionController::Base`
alias :current_soccer_fan :current_user
end
So you don't even need changes in Sorcery to have it done easily.
I agree with @arnvald.
It would be great if you could set the sorcery model to, say, "SoccerFan" (What? The World Cup just started!) and if the current method were to also be available as "current_soccer_fan".
Forcing "current_user" creates a schism in the code where the domain language disappears.