Skip to content

Commit

Permalink
show required_contacts status
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 15, 2021
1 parent e6f65e7 commit f8e7ff2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
25 changes: 13 additions & 12 deletions app/serializers/provider_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ProviderSerializer
:service_contact,
:secondary_service_contact,
:voting_contact,
:has_required_contacts,
:created,
:updated

Expand Down Expand Up @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions app/serializers/v3/provider_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit f8e7ff2

Please sign in to comment.