diff --git a/app/controllers/api/v1/registrant/registry_locks_controller.rb b/app/controllers/api/v1/registrant/registry_locks_controller.rb index a8c78925b..8274f5754 100644 --- a/app/controllers/api/v1/registrant/registry_locks_controller.rb +++ b/app/controllers/api/v1/registrant/registry_locks_controller.rb @@ -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'] } diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index 18b9506f3..8f39e3da1 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -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] }) diff --git a/test/models/registrant_user_test.rb b/test/models/registrant_user_test.rb index b04829999..3490e35c0 100644 --- a/test/models/registrant_user_test.rb +++ b/test/models/registrant_user_test.rb @@ -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.