diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-09-20 15:06:54 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-09-20 16:05:25 +0530 |
commit | 8957293d9bd0d711db3af26182205c2fe4125194 (patch) | |
tree | dcdd25393e2d6248971fddbd6c9eac30fe27ff6e /app/models/merge_request | |
parent | fa890604aaf15b9e4f0199e6a4cff24c29955a37 (diff) | |
download | gitlab-ce-8957293d9bd0d711db3af26182205c2fe4125194.tar.gz |
Implement review comments from @yorickpeterse
1. Change multiple updates to a single `update_all`
2. Use cascading deletes
3. Extract an average function for the database median.
4. Move database median to `lib/gitlab/database`
5. Use `delete_all` instead of `destroy_all`
6. Minor refactoring
Diffstat (limited to 'app/models/merge_request')
-rw-r--r-- | app/models/merge_request/metrics.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/app/models/merge_request/metrics.rb b/app/models/merge_request/metrics.rb index 8c42c830fac..697a2e303fb 100644 --- a/app/models/merge_request/metrics.rb +++ b/app/models/merge_request/metrics.rb @@ -8,16 +8,4 @@ class MergeRequest::Metrics < ActiveRecord::Base self.save if self.changed? end - - def record_production_deploy!(deploy_time) - self.update(first_deployed_to_production_at: deploy_time) if self.first_deployed_to_production_at.blank? - end - - def record_latest_build_start_time!(start_time) - self.update(latest_build_started_at: start_time, latest_build_finished_at: nil) - end - - def record_latest_build_finish_time!(finish_time) - self.update(latest_build_finished_at: finish_time) - end end |