Commit 7147f050 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 70de3ecd 4e8450af
...@@ -50,8 +50,8 @@ class MergeRequest < ActiveRecord::Base ...@@ -50,8 +50,8 @@ class MergeRequest < ActiveRecord::Base
# is the inverse of MergeRequest#merge_request_diff, which means it may not be # is the inverse of MergeRequest#merge_request_diff, which means it may not be
# the latest diff, because we could have loaded any diff from this particular # the latest diff, because we could have loaded any diff from this particular
# MR. If we haven't already loaded a diff, then it's fine to load the latest. # MR. If we haven't already loaded a diff, then it's fine to load the latest.
def merge_request_diff(*args) def merge_request_diff
fallback = latest_merge_request_diff if args.empty? && !association(:merge_request_diff).loaded? fallback = latest_merge_request_diff unless association(:merge_request_diff).loaded?
fallback || super fallback || super
end end
...@@ -622,10 +622,6 @@ class MergeRequest < ActiveRecord::Base ...@@ -622,10 +622,6 @@ class MergeRequest < ActiveRecord::Base
end end
end end
def reload_merge_request_diff
merge_request_diff(true)
end
def viewable_diffs def viewable_diffs
@viewable_diffs ||= merge_request_diffs.viewable.to_a @viewable_diffs ||= merge_request_diffs.viewable.to_a
end end
......
---
title: Passing an argument to force an association to reload is now deprecated
merge_request: 23894
author: Jasper Maes
type: other
...@@ -2243,7 +2243,7 @@ describe MergeRequest do ...@@ -2243,7 +2243,7 @@ describe MergeRequest do
head_commit_sha: commit.sha head_commit_sha: commit.sha
) )
subject.merge_request_diff(true) subject.reload_merge_request_diff
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment