summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-05 20:38:35 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-05 20:49:31 +0100
commitdb2d067eecc5d40e5f5b4e50a9d8ab505b207e54 (patch)
tree0b52580380a7d3ab83c69ae06ef876ea4c5768ea
parent8de1f7159c5141abe60c6679960f2008482e32bf (diff)
downloadgitlab-ce-db2d067eecc5d40e5f5b4e50a9d8ab505b207e54.tar.gz
Fix project destroy callbackfix/project-destroy-callbacks
See gitlab-org/gitlab-ee!107.
-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