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
3778a136
Commit
3778a136
authored
Jun 14, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rails5 fix passing Group objects array into for_projects_and_groups milestone scope
parent
4791f771
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+2
-2
changelogs/unreleased/rails5-fix-47836.yml
changelogs/unreleased/rails5-fix-47836.yml
+6
-0
lib/banzai/filter/milestone_reference_filter.rb
lib/banzai/filter/milestone_reference_filter.rb
+1
-1
No files found.
app/controllers/projects/milestones_controller.rb
View file @
3778a136
...
@@ -123,9 +123,9 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -123,9 +123,9 @@ class Projects::MilestonesController < Projects::ApplicationController
def
search_params
def
search_params
if
request
.
format
.
json?
&&
@project
.
group
&&
can?
(
current_user
,
:read_group
,
@project
.
group
)
if
request
.
format
.
json?
&&
@project
.
group
&&
can?
(
current_user
,
:read_group
,
@project
.
group
)
groups
=
@project
.
group
.
self_and_ancestors
groups
=
@project
.
group
.
self_and_ancestors
_ids
end
end
params
.
permit
(
:state
).
merge
(
project_ids:
@project
.
id
,
group_ids:
groups
&
.
select
(
:id
)
)
params
.
permit
(
:state
).
merge
(
project_ids:
@project
.
id
,
group_ids:
groups
)
end
end
end
end
changelogs/unreleased/rails5-fix-47836.yml
0 → 100644
View file @
3778a136
---
title
:
Rails5 fix passing Group objects array into for_projects_and_groups milestone
scope
merge_request
:
19863
author
:
Jasper Maes
type
:
fixed
lib/banzai/filter/milestone_reference_filter.rb
View file @
3778a136
...
@@ -65,7 +65,7 @@ module Banzai
...
@@ -65,7 +65,7 @@ module Banzai
# We don't support IID lookups for group milestones, because IIDs can
# We don't support IID lookups for group milestones, because IIDs can
# clash between group and project milestones.
# clash between group and project milestones.
if
project
.
group
&&
!
params
[
:iid
]
if
project
.
group
&&
!
params
[
:iid
]
finder_params
[
:group_ids
]
=
project
.
group
.
self_and_ancestors
.
select
(
:id
)
finder_params
[
:group_ids
]
=
project
.
group
.
self_and_ancestors
_ids
end
end
MilestonesFinder
.
new
(
finder_params
).
find_by
(
params
)
MilestonesFinder
.
new
(
finder_params
).
find_by
(
params
)
...
...
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