File tree Expand file tree Collapse file tree
lib/github/plan_execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,8 +34,12 @@ class Finished
3434 #
3535 # @param [Hash] payload The payload containing information about the CheckSuite.
3636 def initialize ( payload )
37- @check_suite = CheckSuite . find_by ( bamboo_ci_ref : payload [ 'bamboo_ref' ] ) if payload [ 'bamboo_ref' ]
38- @check_suite = CheckSuite . find ( payload [ 'check_suite_id' ] ) if payload [ 'check_suite_id' ]
37+ @check_suite = CheckSuite . where (
38+ bamboo_ci_ref : payload [ 'bamboo_ref' ]
39+ ) . or (
40+ CheckSuite . where ( id : payload [ 'check_suite_id' ] )
41+ ) . last
42+
3943 @logger = GithubLogger . instance . create ( 'github_plan_execution_finished.log' , Logger ::INFO )
4044 @hanged = payload [ 'hanged' ] || false
4145 end
Original file line number Diff line number Diff line change 2424 end
2525 end
2626
27+ after do
28+ if described_class . instance_variable_defined? ( :@singleton__instance__ )
29+ described_class . __send__ ( :remove_instance_variable , :@singleton__instance__ )
30+ end
31+ end
32+
2733 describe '.instance' do
2834 it 'returns a singleton instance' do
2935 expect ( described_class . instance ) . to be_a ( described_class )
You can’t perform that action at this time.
0 commit comments