Skip to content

Commit

Permalink
Update contact.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 22, 2021
1 parent ca479a6 commit 1a7d88d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/models/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit 1a7d88d

Please sign in to comment.