Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7147f050
Commit
7147f050
authored
Dec 18, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
70de3ecd
4e8450af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
app/models/merge_request.rb
app/models/merge_request.rb
+2
-6
changelogs/unreleased/force-reload-arguments-2.yml
changelogs/unreleased/force-reload-arguments-2.yml
+5
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+1
-1
No files found.
app/models/merge_request.rb
View file @
7147f050
...
@@ -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
...
...
changelogs/unreleased/force-reload-arguments-2.yml
0 → 100644
View file @
7147f050
---
title
:
Passing an argument to force an association to reload is now deprecated
merge_request
:
23894
author
:
Jasper Maes
type
:
other
spec/models/merge_request_spec.rb
View file @
7147f050
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment