-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module UserImpersonate | ||
class Engine < Rails::Engine | ||
# Devise user model | ||
config.user_class = 'User' | ||
|
||
# User model lookup method | ||
config.user_finder = 'find' | ||
|
||
# Staff user model lookup method | ||
config.staff_finder = 'find' | ||
|
||
# User model primary key attribute | ||
config.user_id_column = 'id' | ||
|
||
# User model name attribute used for search | ||
# Usage: User.where('#{user_name_column} like ?', '%#{params[:search]}%') | ||
config.user_name_column = 'name' | ||
|
||
# User model staff attribute | ||
config.user_is_staff_method = 'staff?' | ||
|
||
# Redirect to this path when entering impersonate mode | ||
config.redirect_on_impersonate = '/' | ||
|
||
# Redirect to this path when leaving impersonate mode | ||
config.redirect_on_revert = '/manage/users' | ||
|
||
# Devise method used to sign user in | ||
config.sign_in_user_method = 'sign_in' | ||
|
||
# For Active Admin "AdminUser" model, use 'AdminUser' | ||
config.staff_class = 'AdminUser' | ||
|
||
# For Active Admin "AdminUser" model, use 'authenticate_admin_user!' | ||
config.authenticate_user_method = 'authenticate_admin_user!' | ||
|
||
# For Active Admin "AdminUser" model, use 'current_admin_user' | ||
config.current_staff = 'current_admin_user' | ||
end | ||
end |