Skip to content

Commit

Permalink
feat: deprecate pacts relation in favour of pb:pacts in latest pacts …
Browse files Browse the repository at this point in the history
…resource
  • Loading branch information
bethesque committed Jul 6, 2018
1 parent 7d587d9 commit ccdd46f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/pact_broker/api/decorators/pact_collection_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@ def create_representable_pact pact
latest_pacts_url(options[:base_url])
end

# This is the LATEST pact URL
links :'pb:pacts' do | options |
represented.collect do | pact |
{
:href => latest_pact_url(options[:base_url], pact),
:title => "Latest pact between #{pact.consumer.name} and #{pact.provider.name}",
}
end
end

# This is the LATEST pact URL
links :pacts do | options |
represented.collect do | pact |
{
:href => latest_pact_url(options[:base_url], pact),
:title => "Latest pact between #{pact.consumer.name} and #{pact.provider.name}",
:name => "DEPRECATED - please use the pb:pacts relation"
}
end
end
Expand Down

0 comments on commit ccdd46f

Please sign in to comment.