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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
f211e47e
Commit
f211e47e
authored
Feb 09, 2018
by
haseeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
closed by field added
parent
56af0631
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
0 deletions
+16
-0
app/models/issue.rb
app/models/issue.rb
+1
-0
app/services/issues/close_service.rb
app/services/issues/close_service.rb
+1
-0
db/migrate/20180209165249_add_closed_by_to_issues.rb
db/migrate/20180209165249_add_closed_by_to_issues.rb
+13
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-0
No files found.
app/models/issue.rb
View file @
f211e47e
...
@@ -23,6 +23,7 @@ class Issue < ActiveRecord::Base
...
@@ -23,6 +23,7 @@ class Issue < ActiveRecord::Base
belongs_to
:project
belongs_to
:project
belongs_to
:moved_to
,
class_name:
'Issue'
belongs_to
:moved_to
,
class_name:
'Issue'
belongs_to
:closed_by
,
class_name:
'User'
has_many
:events
,
as: :target
,
dependent: :destroy
# rubocop:disable Cop/ActiveRecordDependent
has_many
:events
,
as: :target
,
dependent: :destroy
# rubocop:disable Cop/ActiveRecordDependent
...
...
app/services/issues/close_service.rb
View file @
f211e47e
...
@@ -23,6 +23,7 @@ module Issues
...
@@ -23,6 +23,7 @@ module Issues
end
end
if
project
.
issues_enabled?
&&
issue
.
close
if
project
.
issues_enabled?
&&
issue
.
close
issue
.
update
(
closed_by:
current_user
)
event_service
.
close_issue
(
issue
,
current_user
)
event_service
.
close_issue
(
issue
,
current_user
)
create_note
(
issue
,
commit
)
if
system_note
create_note
(
issue
,
commit
)
if
system_note
notification_service
.
close_issue
(
issue
,
current_user
)
if
notifications
notification_service
.
close_issue
(
issue
,
current_user
)
if
notifications
...
...
db/migrate/20180209165249_add_closed_by_to_issues.rb
0 → 100644
View file @
f211e47e
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddClosedByToIssues
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
def
change
add_column
:issues
,
:closed_by_id
,
:integer
end
end
lib/api/entities.rb
View file @
f211e47e
...
@@ -390,6 +390,7 @@ module API
...
@@ -390,6 +390,7 @@ module API
class
IssueBasic
<
ProjectEntity
class
IssueBasic
<
ProjectEntity
expose
:closed_at
expose
:closed_at
expose
:closed_by
,
using:
Entities
::
UserBasic
expose
:labels
do
|
issue
,
options
|
expose
:labels
do
|
issue
,
options
|
# Avoids an N+1 query since labels are preloaded
# Avoids an N+1 query since labels are preloaded
issue
.
labels
.
map
(
&
:title
).
sort
issue
.
labels
.
map
(
&
:title
).
sort
...
...
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