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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f0c26bcb
Commit
f0c26bcb
authored
Jul 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix label set during issue/mr creation
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
9c5edce1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
app/services/issues/create_service.rb
app/services/issues/create_service.rb
+3
-1
app/services/merge_requests/create_service.rb
app/services/merge_requests/create_service.rb
+3
-1
No files found.
app/services/issues/create_service.rb
View file @
f0c26bcb
module
Issues
class
CreateService
<
Issues
::
BaseService
def
execute
issue
=
project
.
issues
.
new
(
params
)
label_params
=
params
[
:label_ids
]
issue
=
project
.
issues
.
new
(
params
.
except
(
:label_ids
))
issue
.
author
=
current_user
if
issue
.
save
issue
.
update_attributes
(
label_ids:
label_params
)
notification_service
.
new_issue
(
issue
,
current_user
)
event_service
.
open_issue
(
issue
,
current_user
)
issue
.
create_cross_references!
(
issue
.
project
,
current_user
)
...
...
app/services/merge_requests/create_service.rb
View file @
f0c26bcb
module
MergeRequests
class
CreateService
<
MergeRequests
::
BaseService
def
execute
merge_request
=
MergeRequest
.
new
(
params
)
label_params
=
params
[
:label_ids
]
merge_request
=
MergeRequest
.
new
(
params
.
except
(
:label_ids
))
merge_request
.
source_project
=
project
merge_request
.
target_project
||=
project
merge_request
.
author
=
current_user
if
merge_request
.
save
merge_request
.
update_attributes
(
label_ids:
label_params
)
event_service
.
open_mr
(
merge_request
,
current_user
)
notification_service
.
new_merge_request
(
merge_request
,
current_user
)
merge_request
.
create_cross_references!
(
merge_request
.
project
,
current_user
)
...
...
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