diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-06 13:00:50 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-06 13:00:50 +0000 |
commit | 8b39b8cd54bb73b485ee6ea7fc5d3bbfbe07cd5d (patch) | |
tree | f3cf875e42775431af4ef97e9c176a6999aab27e | |
parent | 7884a26176c88dddbb37f4ef7a5b7c1a907d3a66 (diff) | |
parent | db2d067eecc5d40e5f5b4e50a9d8ab505b207e54 (diff) | |
download | gitlab-ce-8b39b8cd54bb73b485ee6ea7fc5d3bbfbe07cd5d.tar.gz |
Merge branch 'fix/project-destroy-callbacks' into 'master'
Fix project destroy callback
See gitlab-org/gitlab-ee!107.
See merge request !2307
-rw-r--r-- | app/models/ci/build.rb | 6 |
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 |