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
3743a21d
Commit
3743a21d
authored
Aug 13, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant unscope from assocation
There has been no default_scope on project since
8e8eb978
.
parent
95885c2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
app/models/project_feature.rb
app/models/project_feature.rb
+1
-4
spec/models/project_feature_spec.rb
spec/models/project_feature_spec.rb
+2
-0
No files found.
app/models/project_feature.rb
View file @
3743a21d
...
...
@@ -49,10 +49,7 @@ class ProjectFeature < ApplicationRecord
end
end
# Default scopes force us to unscope here since a service may need to check
# permissions for a project in pending_delete
# http://stackoverflow.com/questions/1540645/how-to-disable-default-scope-for-a-belongs-to
belongs_to
:project
,
->
{
unscope
(
where: :pending_delete
)
}
belongs_to
:project
validates
:project
,
presence:
true
...
...
spec/models/project_feature_spec.rb
View file @
3743a21d
...
...
@@ -8,6 +8,8 @@ RSpec.describe ProjectFeature do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:project
)
}
describe
'PRIVATE_FEATURES_MIN_ACCESS_LEVEL_FOR_PRIVATE_PROJECT'
do
it
'has higher level than that of PRIVATE_FEATURES_MIN_ACCESS_LEVEL'
do
described_class
::
PRIVATE_FEATURES_MIN_ACCESS_LEVEL_FOR_PRIVATE_PROJECT
.
each
do
|
feature
,
level
|
...
...
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