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
d08e1db9
Commit
d08e1db9
authored
May 15, 2013
by
AlexDenisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup bulk issues update a bit
parent
d79592a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
app/contexts/issues/bulk_update_context.rb
app/contexts/issues/bulk_update_context.rb
+11
-8
No files found.
app/contexts/issues/bulk_update_context.rb
View file @
d08e1db9
...
@@ -8,6 +8,13 @@ module Issues
...
@@ -8,6 +8,13 @@ module Issues
assignee_id
=
update_data
[
:assignee_id
]
assignee_id
=
update_data
[
:assignee_id
]
status
=
update_data
[
:status
]
status
=
update_data
[
:status
]
unless
status
.
present?
return
{
count:
0
,
success:
false
}
end
opts
=
{}
opts
=
{}
opts
[
:milestone_id
]
=
milestone_id
if
milestone_id
.
present?
opts
[
:milestone_id
]
=
milestone_id
if
milestone_id
.
present?
opts
[
:assignee_id
]
=
assignee_id
if
assignee_id
.
present?
opts
[
:assignee_id
]
=
assignee_id
if
assignee_id
.
present?
...
@@ -15,16 +22,12 @@ module Issues
...
@@ -15,16 +22,12 @@ module Issues
issues
=
Issue
.
where
(
id:
issues_ids
).
all
issues
=
Issue
.
where
(
id:
issues_ids
).
all
issues
=
issues
.
select
{
|
issue
|
can?
(
current_user
,
:modify_issue
,
issue
)
}
issues
=
issues
.
select
{
|
issue
|
can?
(
current_user
,
:modify_issue
,
issue
)
}
new_state
=
:reopen
new_state
=
:close
if
status
==
'closed'
issues
.
each
do
|
issue
|
issues
.
each
do
|
issue
|
issue
.
update_attributes
(
opts
)
issue
.
update_attributes
(
opts
)
issue
.
send
new_state
if
status
.
present?
if
status
==
'closed'
issue
.
close
else
issue
.
reopen
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