From 1a7d88de8c71c682d401ea3cd38e2c72412bb808 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 22 Apr 2021 20:53:19 +0200 Subject: [PATCH] Update contact.rb --- app/models/contact.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index bae94e982..3013dede7 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -225,8 +225,8 @@ def as_indexed_json(options = {}) "name" => name, "email" => email, "role_name" => role_name, - "provider_id" => provider_id, - "consortium_id" => consortium_id, + "provider_id" => provider_id.upcase, + "consortium_id" => consortium_id.present? ? consortium_id.upcase : nil, "created_at" => created_at.try(:iso8601), "updated_at" => updated_at.try(:iso8601), "deleted_at" => deleted_at.try(:iso8601), @@ -239,18 +239,18 @@ def as_indexed_json(options = {}) } end - # attributes to be sent to elasticsearch index + # attributes to be sent to message bus def to_jsonapi attributes = { "uid" => uid, - "fabrica_id" => provider_id + "-" + email, + "fabrica_id" => provider_id.upcase + "-" + email, "given_name" => given_name, "family_name" => family_name, "name" => name, "email" => email, "role_name" => Array.wrap(role_name).map(&:classify), - "provider_id" => provider_id, - "consortium_id" => consortium_id, + "provider_id" => provider_id.upcase, + "consortium_id" => consortium_id.present? ? consortium_id.upcase : nil, "created_at" => created_at.try(:iso8601), "updated_at" => updated_at.try(:iso8601), "deleted_at" => deleted_at.try(:iso8601),