diff --git a/lib/pact_broker/api/decorators/versions_decorator.rb b/lib/pact_broker/api/decorators/versions_decorator.rb index f13b0189c..b074992e5 100644 --- a/lib/pact_broker/api/decorators/versions_decorator.rb +++ b/lib/pact_broker/api/decorators/versions_decorator.rb @@ -2,12 +2,8 @@ require_relative 'version_decorator' module PactBroker - module Api - module Decorators - - class VersionsDecorator < BaseDecorator collection :entries, as: :versions, embedded: true, :extend => PactBroker::Api::Decorators::VersionDecorator @@ -19,14 +15,14 @@ class VersionsDecorator < BaseDecorator } end - link :pacticipant do | context | + link :'pb:pacticipant' do | context | { href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])), title: context[:pacticipant_name] } end - links :'versions' do | context | + links :'pb:versions' do | context | represented.collect do | version | { :href => version_url(context[:base_url], version), @@ -35,6 +31,21 @@ class VersionsDecorator < BaseDecorator end end + link :pacticipant do | context | + { + href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])), + title: 'Deprecated - please use pb:pacticipant' + } + end + + links :'versions' do | context | + represented.collect do | version | + { + :href => version_url(context[:base_url], version), + :title => 'Deprecated - please use pb:versions' + } + end + end end end end