BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7cb8ceb5
Unverified
Commit
7cb8ceb5
authored
Aug 02, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creation and reload of the merge request diff
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
6515ec09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
merge_request.rb
app/models/merge_request.rb
+12
-2
No files found.
app/models/merge_request.rb
View file @
7cb8ceb5
...
...
@@ -11,7 +11,9 @@ class MergeRequest < ActiveRecord::Base
belongs_to
:merge_user
,
class_name:
"User"
has_many
:merge_request_diffs
,
dependent: :destroy
has_one
:merge_request_diff
has_one
:merge_request_diff
,
->
{
order
(
'merge_request_diffs.id DESC'
)
}
has_many
:events
,
as: :target
,
dependent: :destroy
serialize
:merge_params
,
Hash
...
...
@@ -287,6 +289,15 @@ class MergeRequest < ActiveRecord::Base
merge_request_diff
||
create_merge_request_diff
end
def
create_merge_request_diff
merge_request_diffs
.
create
reload_merge_request_diff
end
def
reload_merge_request_diff
merge_request_diff
(
true
)
end
def
reload_diff_if_branch_changed
if
source_branch_changed?
||
target_branch_changed?
reload_diff
...
...
@@ -298,7 +309,6 @@ class MergeRequest < ActiveRecord::Base
old_diff_refs
=
self
.
diff_refs
create_merge_request_diff
merge_request_diffs
.
reload
new_diff_refs
=
self
.
diff_refs
update_diff_notes_positions
(
...
...
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