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) },