Commit 2ccbe4fd authored by Kamil Trzciński's avatar Kamil Trzciński Committed by Dylan Griffith

Run `Ci::Runner#assign_to` in transaction

parent bf74e69e
......@@ -120,8 +120,15 @@ module Ci
raise ArgumentError, 'Transitioning a group runner to a project runner is not supported'
end
self.projects << project
self.save
begin
transaction do
self.projects << project
self.save!
end
rescue ActiveRecord::RecordInvalid => e
self.errors.add(:assign_to, e.message)
false
end
end
def display_name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment