Skip to content

Commit

Permalink
include provider salesforce_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 27, 2021
1 parent af497de commit 5db53d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Client < ApplicationRecord
attr_readonly :symbol
delegate :symbol, to: :provider, prefix: true
delegate :consortium_id, to: :provider, allow_nil: true
delegate :salesforce_id, to: :provider, prefix: true, allow_nil: true

attr_accessor :password_input, :target_id

Expand Down Expand Up @@ -630,6 +631,7 @@ def to_jsonapi
"url" => url,
"re3data_id" => re3data_id,
"provider_id" => provider_id,
"provider_salesforce_id" => provider_salesforce_id,
"is_active" => is_active.getbyte(0) == 1,
"dois_total" => dois_total,
"dois_current_year" => dois_current_year,
Expand Down
2 changes: 2 additions & 0 deletions app/models/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Contact < ApplicationRecord
before_create :set_uid

delegate :consortium_id, to: :provider, allow_nil: true
delegate :salesforce_id, to: :provider, prefix: true, allow_nil: true

ROLES = %w[voting billing secondary_billing service secondary_service technical secondary_technical]

Expand Down Expand Up @@ -250,6 +251,7 @@ def to_jsonapi
"email" => email,
"role_name" => Array.wrap(role_name).map(&:classify),
"provider_id" => provider_id.upcase,
"provider_salesforce_id" => provider_salesforce_id,
"consortium_id" => consortium_id.present? ? consortium_id.upcase : nil,
"created_at" => created_at.try(:iso8601),
"updated_at" => updated_at.try(:iso8601),
Expand Down

0 comments on commit 5db53d7

Please sign in to comment.