mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +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
|
@ -6,7 +6,7 @@ module Admin
|
|||
def update
|
||||
authorize! :update, :pending
|
||||
|
||||
if registrant_verification.domain_registrant_change_confirm!("admin #{current_user.username}")
|
||||
if registrant_verification.domain_registrant_change_confirm!("admin #{current_admin_user.username}")
|
||||
redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied)
|
||||
else
|
||||
redirect_to edit_admin_domain_path(@domain.id), alert: t(:failure)
|
||||
|
@ -15,7 +15,7 @@ module Admin
|
|||
|
||||
def destroy
|
||||
authorize! :destroy, :pending
|
||||
if registrant_verification.domain_registrant_change_reject!("admin #{current_user.username}")
|
||||
if registrant_verification.domain_registrant_change_reject!("admin #{current_admin_user.username}")
|
||||
redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed)
|
||||
else
|
||||
redirect_to admin_domain_path(@domain.id), alert: t(:failure)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue