mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +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,11 +1,22 @@
|
|||
class RegistrantController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :authenticate_registrant_user!
|
||||
layout 'registrant/application'
|
||||
|
||||
include Registrant::ApplicationHelper
|
||||
|
||||
helper_method :head_title_sufix
|
||||
|
||||
def head_title_sufix
|
||||
t(:registrant_head_title_sufix)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_ability
|
||||
@current_ability ||= Ability.new(current_registrant_user, request.remote_ip)
|
||||
end
|
||||
|
||||
def user_for_paper_trail
|
||||
current_registrant_user.present? ? current_registrant_user.id_role_username : 'public'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue