summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-04-13 11:01:10 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-13 11:01:10 +0200
commit4d72ca39803615850267d034e9dc59540fe657b7 (patch)
treed3a472ec8ad9020e21ade1e968c9625b3d8844db /app/models
parent234be12e4ee24cda6f6b7963d54af00ceb5e26c8 (diff)
downloadgitlab-ce-4d72ca39803615850267d034e9dc59540fe657b7.tar.gz
Remove the use of default scope for Builds
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb11
1 files changed, 0 insertions, 11 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 15fc714b538..085ecc6951c 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -37,8 +37,6 @@
module Ci
class Build < CommitStatus
- LAZY_ATTRIBUTES = ['trace']
-
belongs_to :runner, class_name: 'Ci::Runner'
belongs_to :trigger_request, class_name: 'Ci::TriggerRequest'
belongs_to :erased_by, class_name: 'User'
@@ -56,20 +54,11 @@ module Ci
acts_as_taggable
- # To prevent db load megabytes of data from trace
- default_scope -> { select(Ci::Build.columns_without_lazy) }
-
before_destroy { project }
after_create :execute_hooks
class << self
- def columns_without_lazy
- (column_names - LAZY_ATTRIBUTES).map do |column_name|
- "#{table_name}.#{column_name}"
- end
- end
-
def last_month
where('created_at > ?', Date.today - 1.month)
end