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
3075eede
Commit
3075eede
authored
Feb 25, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references for confidential issues from autocomplete
parent
4ded8adf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/models/issue.rb
app/models/issue.rb
+1
-0
app/services/projects/autocomplete_service.rb
app/services/projects/autocomplete_service.rb
+1
-1
spec/services/projects/autocomplete_service_spec.rb
spec/services/projects/autocomplete_service_spec.rb
+16
-0
No files found.
app/models/issue.rb
View file @
3075eede
...
...
@@ -45,6 +45,7 @@ class Issue < ActiveRecord::Base
scope
:cared
,
->
(
user
)
{
where
(
assignee_id:
user
)
}
scope
:open_for
,
->
(
user
)
{
opened
.
assigned_to
(
user
)
}
scope
:in_projects
,
->
(
project_ids
)
{
where
(
project_id:
project_ids
)
}
scope
:not_confidential
,
->
{
where
(
confidential:
false
)
}
state_machine
:state
,
initial: :opened
do
event
:close
do
...
...
app/services/projects/autocomplete_service.rb
View file @
3075eede
...
...
@@ -5,7 +5,7 @@ module Projects
end
def
issues
@project
.
issues
.
opened
.
select
([
:iid
,
:title
])
@project
.
issues
.
not_confidential
.
opened
.
select
([
:iid
,
:title
])
end
def
merge_requests
...
...
spec/services/projects/autocomplete_service_spec.rb
0 → 100644
View file @
3075eede
require
'spec_helper'
describe
Projects
::
AutocompleteService
,
services:
true
do
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
subject
(
:autocomplete
)
{
described_class
.
new
(
project
)
}
describe
'#issues'
do
it
'should not list confidential issues'
do
issue
=
create
(
:issue
,
project:
project
)
create
(
:issue
,
:confidential
,
project:
project
)
expect
(
autocomplete
.
issues
.
map
(
&
:iid
)).
to
eq
[
issue
.
iid
]
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