Run Ci::Runner#assign_to
in transaction
This commit is contained in:
parent
bf74e69eeb
commit
2ccbe4fd34
1 changed files with 9 additions and 2 deletions
|
@ -120,8 +120,15 @@ module Ci
|
|||
raise ArgumentError, 'Transitioning a group runner to a project runner is not supported'
|
||||
end
|
||||
|
||||
begin
|
||||
transaction do
|
||||
self.projects << project
|
||||
self.save
|
||||
self.save!
|
||||
end
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
self.errors.add(:assign_to, e.message)
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def display_name
|
||||
|
|
Loading…
Reference in a new issue