Module: DouguiUsers
- Defined in:
- lib/dougui_users.rb,
lib/dougui_users/engine.rb,
lib/dougui_users/version.rb,
app/models/dougui_users/user.rb,
app/mailers/dougui_users/user_mailer.rb,
app/models/dougui_users/user_session.rb,
app/helpers/dougui_users/user_mailer_helper.rb,
app/controllers/dougui_users/users_controller.rb,
app/controllers/dougui_users/application_controller.rb,
app/controllers/dougui_users/user_sessions_controller.rb,
app/controllers/dougui_users/user_activates_controller.rb,
app/controllers/dougui_users/user_reset_passwords_controller.rb
Defined Under Namespace
Modules: UserMailerHelper
Classes: ApplicationController, Engine, User, UserActivatesController, UserMailer, UserResetPasswordsController, UserSession, UserSessionsController, UsersController
Constant Summary
collapse
- VERSION =
"0.0.2"
Instance Method Summary
collapse
Instance Method Details
#current_user ⇒ Object
9
10
11
12
|
# File 'lib/dougui_users.rb', line 9
def current_user
return @current_user if defined?(@current_user)
@current_user = current_user_session && current_user_session.record
end
|
#current_user_session ⇒ Object
4
5
6
7
|
# File 'lib/dougui_users.rb', line 4
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end
|
#restrict_access ⇒ Object
14
15
16
17
18
|
# File 'lib/dougui_users.rb', line 14
def restrict_access
unless current_user
redirect_to login_path, :notice => t('access_denied', :scope => 'application_controller')
end
end
|