diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 12bf285d2..d29d894c5 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -63,7 +63,7 @@ private User.search_by(search_param) else User.all - end.filter_by_active + end.filter_by_active.includes(:organisation) end def org_params diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cb3b5fc51..52ded2ebe 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -82,7 +82,7 @@ private User.search_by(search_param) else User.all - end.filter_by_active + end.filter_by_active.includes(:organisation) end def format_error_messages