@@ -52,21 +52,31 @@ def latest_consumer_version_number
52
52
53
53
def select_provider_tags_with_successful_verifications ( tags )
54
54
tags . select do | tag |
55
+ verifications_join = {
56
+ Sequel [ :verifications ] [ :pact_version_id ] => Sequel [ :pact_versions ] [ :id ] ,
57
+ Sequel [ :verifications ] [ :success ] => true
58
+ }
59
+ tags_join = {
60
+ Sequel [ :tags ] [ :version_id ] => Sequel [ :versions ] [ :id ] ,
61
+ Sequel [ :tags ] [ :name ] => tag
62
+ }
55
63
PactVersion . where ( Sequel [ :pact_versions ] [ :id ] => id )
56
- . join ( :verifications , Sequel [ :verifications ] [ :pact_version_id ] => Sequel [ :pact_versions ] [ :id ] )
64
+ . join ( :verifications , verifications_join )
57
65
. join ( :versions , Sequel [ :versions ] [ :id ] => Sequel [ :verifications ] [ :provider_version_id ] )
58
- . join ( :tags , Sequel [ :tags ] [ :version_id ] => Sequel [ :versions ] [ :id ] )
59
- . where ( Sequel [ :tags ] [ :name ] => tag )
60
- . where ( Sequel [ :verifications ] [ :success ] => true )
66
+ . join ( :tags , tags_join )
61
67
. any?
62
68
end
63
69
end
64
70
65
71
def verified_successfully_by_any_provider_version?
72
+ verifications_join = {
73
+ Sequel [ :verifications ] [ :pact_version_id ] => Sequel [ :pact_versions ] [ :id ] ,
74
+ Sequel [ :verifications ] [ :pact_version_id ] => id ,
75
+ Sequel [ :verifications ] [ :success ] => true
76
+ }
66
77
PactVersion . where ( Sequel [ :pact_versions ] [ :id ] => id )
67
- . join ( :verifications , Sequel [ :verifications ] [ :pact_version_id ] => Sequel [ :pact_versions ] [ :id ] )
78
+ . join ( :verifications , verifications_join )
68
79
. join ( :versions , Sequel [ :versions ] [ :id ] => Sequel [ :verifications ] [ :provider_version_id ] )
69
- . where ( Sequel [ :verifications ] [ :success ] => true )
70
80
. any?
71
81
end
72
82
0 commit comments