Add Users::RegistrationPolicy#update?
This commit is contained in:
parent
d91def8c34
commit
f7e1c85791
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Users::RegistrationPolicy < ApplicationPolicy
|
||||
def update?
|
||||
!account&.user.nil?
|
||||
end
|
||||
end
|
|
@ -6,10 +6,12 @@
|
|||
"#{:active if tab == :profile}" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to translate(:credentials, scope: %i[nav_tabs settings]),
|
||||
edit_user_registration_path,
|
||||
class: 'list-group-item list-group-item-action ' \
|
||||
"#{:active if tab == :credentials}" %>
|
||||
<% if policy(%i[users registration]).edit? %>
|
||||
<%= link_to translate(:credentials, scope: %i[nav_tabs settings]),
|
||||
edit_user_registration_path,
|
||||
class: 'list-group-item list-group-item-action ' \
|
||||
"#{:active if tab == :credentials}" %>
|
||||
<% end %>
|
||||
|
||||
<% if policy(%i[settings account_telegram_contact]).index? %>
|
||||
<%= link_to translate(:telegram_contacts, scope: %i[nav_tabs settings]),
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Users::RegistrationPolicy do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Reference in New Issue