diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-03 19:58:58 -0400 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-04 00:11:33 -0400 |
commit | 3286dd7a1db69460573a5fd2c9e997039b1f406b (patch) | |
tree | fba63dd375acb038a1e27f03eb9ba7530578cefd /app/models/todo.rb | |
parent | 0ccdc631e6f45c0fd327631decb47f80d781302e (diff) | |
download | gitlab-ce-3286dd7a1db69460573a5fd2c9e997039b1f406b.tar.gz |
Don't garbage collect commits that have related DB records like comments
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r-- | app/models/todo.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb index 3ba67078d48..ac3fdbc7f3b 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -37,6 +37,8 @@ class Todo < ActiveRecord::Base state :done end + after_save :keep_around_commit + def build_failed? action == BUILD_FAILED end @@ -73,4 +75,10 @@ class Todo < ActiveRecord::Base target.to_reference end end + + private + + def keep_around_commit + project.repository.keep_around(self.commit_id) + end end |