From f8e7ff2d0cd229b74f618e47b0f7443ceb5f4ea9 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 15 Apr 2021 13:03:56 +0200 Subject: [PATCH] show required_contacts status --- app/serializers/provider_serializer.rb | 25 ++++++++++++----------- app/serializers/v3/provider_serializer.rb | 14 +++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/app/serializers/provider_serializer.rb b/app/serializers/provider_serializer.rb index f00e74b03..1789389d3 100644 --- a/app/serializers/provider_serializer.rb +++ b/app/serializers/provider_serializer.rb @@ -36,6 +36,7 @@ class ProviderSerializer :service_contact, :secondary_service_contact, :voting_contact, + :has_required_contacts, :created, :updated @@ -272,18 +273,18 @@ class ProviderSerializer end attribute :has_required_contacts, - if: - Proc.new { |object, params| - params[:current_ability] && - params[:current_ability].can?( - :read_contact_information, - object, - ) == - true - } do |object| - object.has_required_contacts - end -end + if: + Proc.new { |object, params| + params[:current_ability] && + params[:current_ability].can?( + :read_contact_information, + object, + ) == + true + } do |object| + object.has_required_contacts + end + end attribute :salesforce_id, if: diff --git a/app/serializers/v3/provider_serializer.rb b/app/serializers/v3/provider_serializer.rb index caf533008..5262254ce 100644 --- a/app/serializers/v3/provider_serializer.rb +++ b/app/serializers/v3/provider_serializer.rb @@ -271,6 +271,20 @@ class V3::ProviderSerializer end end + attribute :has_required_contacts, + if: + Proc.new { |object, params| + params[:current_ability] && + params[:current_ability].can?( + :read_contact_information, + object, + ) == + true + } do |object| + object.has_required_contacts + end + end + attribute :salesforce_id, if: Proc.new { |object, params|