summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/ci/build.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 3e67b2771c1..d7fccb2197d 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -54,6 +54,8 @@ module Ci
# To prevent db load megabytes of data from trace
default_scope -> { select(Ci::Build.columns_without_lazy) }
+ before_destroy { project }
+
class << self
def columns_without_lazy
(column_names - LAZY_ATTRIBUTES).map do |column_name|
@@ -145,10 +147,6 @@ module Ci
end
end
- def project
- commit.project
- end
-
def project_id
commit.project.id
end