mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Fix typo in administered_domains method name
This commit is contained in:
parent
fc2a4eaa9b
commit
d725960403
3 changed files with 4 additions and 4 deletions
|
@ -35,7 +35,7 @@ module Api
|
|||
end
|
||||
|
||||
def authorized_to_manage_locks?
|
||||
return if current_user.administrated_domains.include?(@domain)
|
||||
return if current_user.administered_domains.include?(@domain)
|
||||
|
||||
render json: { errors: [
|
||||
{ base: ['Only administrative contacts can manage registry locks'] }
|
||||
|
|
|
@ -28,7 +28,7 @@ class RegistrantUser < User
|
|||
# In Rails 5, can be replaced with a much simpler `or` query method and the raw SQL parts can be
|
||||
# removed.
|
||||
# https://guides.rubyonrails.org/active_record_querying.html#or-conditions
|
||||
def administrated_domains
|
||||
def administered_domains
|
||||
domains_where_is_administrative_contact = begin
|
||||
Domain.joins(:domain_contacts)
|
||||
.where(domain_contacts: { contact_id: contacts, type: [AdminDomainContact] })
|
||||
|
|
|
@ -19,8 +19,8 @@ class RegistrantUserTest < ActiveSupport::TestCase
|
|||
refute(domain_names.include?('shop.test'))
|
||||
end
|
||||
|
||||
def test_administrated_domains_returns_a_list_of_domains
|
||||
domain_names = @user.administrated_domains.pluck(:name)
|
||||
def test_administered_domains_returns_a_list_of_domains
|
||||
domain_names = @user.administered_domains.pluck(:name)
|
||||
assert_equal(3, domain_names.length)
|
||||
|
||||
# User is a tech contact for the domain.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue