From c5045e9a8960e5acb1234e2288ed9a888b378982 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 23 Mar 2020 10:20:01 +0100 Subject: [PATCH] reduce indexing of prefix associations. #389 --- app/models/client.rb | 2 +- app/models/provider_prefix.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/client.rb b/app/models/client.rb index b40d75904..4a83e7bf4 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -241,7 +241,7 @@ def as_indexed_json(options={}) "updated" => updated, "deleted_at" => deleted_at, "cumulative_years" => cumulative_years, - "provider" => provider.as_indexed_json + "provider" => provider.as_indexed_json(exclude_associations: true) } end diff --git a/app/models/provider_prefix.rb b/app/models/provider_prefix.rb index e27177277..45a2c576b 100644 --- a/app/models/provider_prefix.rb +++ b/app/models/provider_prefix.rb @@ -58,7 +58,7 @@ def as_indexed_json(options={}) "state" => state, "created_at" => created_at, "updated_at" => updated_at, - "provider" => provider.try(:as_indexed_json), + "provider" => provider.try(:as_indexed_json, exclude_associations: true), "prefix" => options[:exclude_associations] ? nil : prefix.try(:as_indexed_json, exclude_associations: true), "clients" => options[:exclude_associations] ? nil : clients.map { |m| m.try(:as_indexed_json, exclude_associations: true) }, "client_prefixes" => options[:exclude_associations] ? nil : client_prefixes.map { |m| m.try(:as_indexed_json, exclude_associations: true) },