Skip to content

Commit

Permalink
reduce indexing of prefix associations. #389
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 23, 2020
1 parent 1d961e7 commit c5045e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/models/provider_prefix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down

0 comments on commit c5045e9

Please sign in to comment.