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
Jérome Perrin
gitlab-ce
Commits
7b77e286
Commit
7b77e286
authored
Jun 29, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Namespace model default scope override and write additional test to Project search
parent
eb175d5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
app/models/namespace.rb
app/models/namespace.rb
+1
-3
spec/models/project_spec.rb
spec/models/project_spec.rb
+10
-0
No files found.
app/models/namespace.rb
View file @
7b77e286
class
Namespace
<
ActiveRecord
::
Base
acts_as_paranoid
acts_as_paranoid
without_default_scope:
true
include
CacheMarkdownField
include
Sortable
...
...
@@ -47,8 +47,6 @@ class Namespace < ActiveRecord::Base
before_destroy
(
prepend:
true
)
{
prepare_for_destroy
}
after_destroy
:rm_dir
default_scope
{
with_deleted
}
scope
:for_user
,
->
{
where
(
'type IS NULL'
)
}
scope
:with_statistics
,
->
do
...
...
spec/models/project_spec.rb
View file @
7b77e286
...
...
@@ -1170,6 +1170,16 @@ describe Project, models: true do
expect
(
relation
.
search
(
project
.
namespace
.
name
)).
to
eq
([
project
])
end
describe
'with pending_delete project'
do
let
(
:pending_delete_project
)
{
create
(
:empty_project
,
pending_delete:
true
)
}
it
'shows pending deletion project'
do
search_result
=
described_class
.
search
(
pending_delete_project
.
name
)
expect
(
search_result
).
to
eq
([
pending_delete_project
])
end
end
end
describe
'#rename_repo'
do
...
...
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