mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 21:54:48 +02:00
Refactor Devise integration
- Use scoped users - Use the named route helpers instead of hardcoded paths
This commit is contained in:
parent
c31f507c25
commit
9684c8e59f
52 changed files with 313 additions and 280 deletions
|
@ -1,10 +1,20 @@
|
|||
module Admin
|
||||
class BaseController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :authenticate_admin_user!
|
||||
helper_method :head_title_sufix
|
||||
|
||||
def head_title_sufix
|
||||
t(:admin_head_title_sufix)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_ability
|
||||
@current_ability ||= Ability.new(current_admin_user)
|
||||
end
|
||||
|
||||
def user_for_paper_trail
|
||||
current_admin_user.present? ? current_admin_user.id_role_username : 'public'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue