@@ -23,10 +23,10 @@ def find selectors, options = {}
23
23
lines = apply_scope ( options , selectors , lines )
24
24
25
25
if options . key? ( :success )
26
- lines = lines . select { |l | options [ :success ] . include? ( l [ : success] ) }
26
+ lines = lines . select { |l | options [ :success ] . include? ( l . success ) }
27
27
end
28
28
29
- lines
29
+ lines . sort . collect ( & :values )
30
30
end
31
31
32
32
def all_versions_specified? selectors
@@ -41,20 +41,18 @@ def apply_scope options, selectors, lines
41
41
when 'cp' then GROUP_BY_PACT
42
42
end
43
43
44
- lines . group_by { |line | group_by_columns . collect { |key | line [ key ] } }
44
+ lines . group_by { |line | group_by_columns . collect { |key | line . send ( key ) } }
45
45
. values
46
- . collect { | lines | lines . first [ : provider_version_number] . nil? ? lines : lines . last }
46
+ . collect { | lines | lines . first . provider_version_number . nil? ? lines : lines . last }
47
47
. flatten
48
48
end
49
49
50
50
def find_for_consumer_and_provider pacticipant_1_name , pacticipant_2_name
51
51
selectors = [ { pacticipant_name : pacticipant_1_name } , { pacticipant_name : pacticipant_2_name } ]
52
- find_all ( selectors , { latestby : 'cvpv' } )
53
- . sort { |l1 , l2 | l2 [ :consumer_version_order ] <=> l1 [ :consumer_version_order ] }
52
+ find_all ( selectors , { latestby : 'cvpv' } ) . sort . collect ( &:values )
54
53
end
55
54
56
55
def find_compatible_pacticipant_versions selectors
57
-
58
56
find ( selectors , latestby : 'cvpv' )
59
57
. select { |line | line [ :success ] }
60
58
end
@@ -69,11 +67,10 @@ def find_all selectors, options
69
67
if selectors . size == 1
70
68
query = where_consumer_or_provider_is ( selectors . first , query )
71
69
else
72
- query = where_consumer_and_provider_within ( selectors , query )
70
+ query = where_consumer_and_provider_in ( selectors , query )
73
71
end
74
72
75
- query . order ( :verification_executed_at , :verification_id )
76
- . collect ( &:values )
73
+ query . order ( :verification_executed_at , :verification_id ) . all
77
74
end
78
75
79
76
def base_table ( options )
@@ -103,7 +100,7 @@ def look_up_versions_for_tags(selectors)
103
100
end
104
101
end
105
102
106
- def where_consumer_and_provider_within selectors , query
103
+ def where_consumer_and_provider_in selectors , query
107
104
query . where {
108
105
Sequel . &(
109
106
Sequel . |(
0 commit comments