From f39fb1dc8b61a5dbe3486cd59588d3496e0c9076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 22 May 2020 10:37:52 +0300 Subject: [PATCH] Provide full Contact object to all_domains() instead of just id --- app/controllers/registrant/contacts_controller.rb | 2 +- app/models/contact.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/registrant/contacts_controller.rb b/app/controllers/registrant/contacts_controller.rb index 136596ede..49070ebde 100644 --- a/app/controllers/registrant/contacts_controller.rb +++ b/app/controllers/registrant/contacts_controller.rb @@ -6,7 +6,7 @@ class Registrant::ContactsController < RegistrantController before_action :set_contact, only: [:show] def show - @requester_contact = Contact.find_by(ident: current_registrant_user.ident).id + @requester_contact = Contact.find_by(ident: current_registrant_user.ident) authorize! :read, @contact end diff --git a/app/models/contact.rb b/app/models/contact.rb index 58d8b8c60..de97547b8 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -451,9 +451,8 @@ class Contact < ApplicationRecord end def qualified_domain_name_list(requester, filter_sql) - return Domain.where('domains.id IN (?)', filter_sql) if requester.nil? + return Domain.where('domains.id IN (?)', filter_sql) unless requester.present? - requester = Contact.find_by(id: requester) registrant_user = RegistrantUser.find_or_initialize_by(registrant_ident: "#{requester.ident_country_code}-#{requester.ident}") begin