diff --git a/lib/pact_broker/api/decorators/pact_collection_decorator.rb b/lib/pact_broker/api/decorators/pact_collection_decorator.rb index e4f6bc3e9..a02918d0e 100644 --- a/lib/pact_broker/api/decorators/pact_collection_decorator.rb +++ b/lib/pact_broker/api/decorators/pact_collection_decorator.rb @@ -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