2
2
require_relative 'version_decorator'
3
3
4
4
module PactBroker
5
-
6
5
module Api
7
-
8
6
module Decorators
9
-
10
-
11
7
class VersionsDecorator < BaseDecorator
12
8
13
9
collection :entries , as : :versions , embedded : true , :extend => PactBroker ::Api ::Decorators ::VersionDecorator
@@ -19,14 +15,14 @@ class VersionsDecorator < BaseDecorator
19
15
}
20
16
end
21
17
22
- link :pacticipant do | context |
18
+ link :'pb: pacticipant' do | context |
23
19
{
24
20
href : pacticipant_url ( context [ :base_url ] , OpenStruct . new ( name : context [ :pacticipant_name ] ) ) ,
25
21
title : context [ :pacticipant_name ]
26
22
}
27
23
end
28
24
29
- links :'versions' do | context |
25
+ links :'pb: versions' do | context |
30
26
represented . collect do | version |
31
27
{
32
28
:href => version_url ( context [ :base_url ] , version ) ,
@@ -35,6 +31,21 @@ class VersionsDecorator < BaseDecorator
35
31
end
36
32
end
37
33
34
+ link :pacticipant do | context |
35
+ {
36
+ href : pacticipant_url ( context [ :base_url ] , OpenStruct . new ( name : context [ :pacticipant_name ] ) ) ,
37
+ title : 'Deprecated - please use pb:pacticipant'
38
+ }
39
+ end
40
+
41
+ links :'versions' do | context |
42
+ represented . collect do | version |
43
+ {
44
+ :href => version_url ( context [ :base_url ] , version ) ,
45
+ :title => 'Deprecated - please use pb:versions'
46
+ }
47
+ end
48
+ end
38
49
end
39
50
end
40
51
end
0 commit comments