summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormicael.bergeron <micaelbergeron@gmail.com>2017-11-06 09:03:11 -0500
committermicael.bergeron <micaelbergeron@gmail.com>2017-11-06 09:03:11 -0500
commitbb0543ef4782febe4dd0f26fc8a476b743fb86ca (patch)
tree9320fd05f6c1eb2f57cdd6fc65493a9366dce17d
parent6c1c64d4bb36099fa4876db309b5f8873650e909 (diff)
downloadgitlab-ce-bb0543ef4782febe4dd0f26fc8a476b743fb86ca.tar.gz
ignore the column before the migration
reword the changelog remove dead code in the specs
-rw-r--r--app/models/merge_request.rb3
-rw-r--r--changelogs/unreleased/remove-ensure-ref-fetched-from-controllers.yml2
-rw-r--r--spec/factories/merge_requests.rb4
-rw-r--r--spec/requests/api/merge_requests_spec.rb2
-rw-r--r--spec/requests/api/v3/merge_requests_spec.rb2
5 files changed, 5 insertions, 8 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index ccad8e102aa..f80601f3484 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -8,7 +8,8 @@ class MergeRequest < ActiveRecord::Base
include CreatedAtFilterable
include TimeTrackable
- ignore_column :locked_at
+ ignore_column :locked_at,
+ :ref_fetched
belongs_to :target_project, class_name: "Project"
belongs_to :source_project, class_name: "Project"
diff --git a/changelogs/unreleased/remove-ensure-ref-fetched-from-controllers.yml b/changelogs/unreleased/remove-ensure-ref-fetched-from-controllers.yml
index 24a4bf561d4..57f54bec1e6 100644
--- a/changelogs/unreleased/remove-ensure-ref-fetched-from-controllers.yml
+++ b/changelogs/unreleased/remove-ensure-ref-fetched-from-controllers.yml
@@ -1,5 +1,5 @@
---
-title: Removed merge requests fetching their refs on every action.
+title: Stop merge requests from fetching their refs when the data is already available.
merge_request: 15129
author:
type: removed
diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb
index 7c4a22c94c2..cc6cef63b47 100644
--- a/spec/factories/merge_requests.rb
+++ b/spec/factories/merge_requests.rb
@@ -83,10 +83,10 @@ FactoryGirl.define do
target_project = merge_request.target_project
source_project = merge_request.source_project
- # Fake `write_ref` if we don't have repository
+ # Fake `fetch_ref!` if we don't have repository
# We have too many existing tests replying on this behaviour
unless [target_project, source_project].all?(&:repository_exists?)
- allow(merge_request).to receive(:write_ref)
+ allow(merge_request).to receive(:fetch_ref!)
end
end
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 024cfe8b372..e16be3c46e1 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -623,8 +623,6 @@ describe API::MergeRequests do
before do
forked_project.add_reporter(user2)
-
- allow_any_instance_of(MergeRequest).to receive(:write_ref)
end
it "returns merge_request" do
diff --git a/spec/requests/api/v3/merge_requests_spec.rb b/spec/requests/api/v3/merge_requests_spec.rb
index 26251b95680..91897e5ee01 100644
--- a/spec/requests/api/v3/merge_requests_spec.rb
+++ b/spec/requests/api/v3/merge_requests_spec.rb
@@ -319,8 +319,6 @@ describe API::MergeRequests do
before do
forked_project.add_reporter(user2)
-
- allow_any_instance_of(MergeRequest).to receive(:write_ref)
end
it "returns merge_request" do