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
b861ed30
Commit
b861ed30
authored
Dec 04, 2021
by
Siddharth Asthana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Gitlab/DelegatePredicateMethods offenses
Changelog: other EE: true
parent
24e17424
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
.rubocop_todo/gitlab/delegate_predicate_methods.yml
.rubocop_todo/gitlab/delegate_predicate_methods.yml
+0
-1
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+22
-4
ee/spec/requests/api/users_spec.rb
ee/spec/requests/api/users_spec.rb
+1
-1
No files found.
.rubocop_todo/gitlab/delegate_predicate_methods.yml
View file @
b861ed30
...
...
@@ -6,6 +6,5 @@ Gitlab/DelegatePredicateMethods:
-
app/models/concerns/integrations/base_data_fields.rb
-
app/models/project.rb
-
ee/app/models/concerns/ee/ci/metadatable.rb
-
ee/app/models/ee/namespace.rb
-
ee/app/models/license.rb
-
lib/gitlab/ci/trace/stream.rb
ee/app/models/ee/namespace.rb
View file @
b861ed30
...
...
@@ -82,7 +82,6 @@ module EE
delegate
:additional_purchased_storage_size
,
:additional_purchased_storage_size
=
,
:additional_purchased_storage_ends_on
,
:additional_purchased_storage_ends_on
=
,
:temporary_storage_increase_ends_on
,
:temporary_storage_increase_ends_on
=
,
:temporary_storage_increase_enabled?
,
:eligible_for_temporary_storage_increase?
,
to: :namespace_limit
,
allow_nil:
true
delegate
:email
,
to: :owner
,
allow_nil:
true
,
prefix:
true
...
...
@@ -96,9 +95,8 @@ module EE
numericality:
{
only_integer:
true
,
greater_than_or_equal_to:
0
,
allow_nil:
true
,
less_than:
::
Gitlab
::
Pages
::
MAX_SIZE
/
1
.
megabyte
}
delegate
:trial?
,
:trial_ends_on
,
:trial_starts_on
,
:trial_days_remaining
,
:trial_percentage_complete
,
:upgradable?
,
:trial_extended_or_reactivated?
,
to: :gitlab_subscription
,
allow_nil:
true
delegate
:trial_ends_on
,
:trial_starts_on
,
:trial_days_remaining
,
:trial_percentage_complete
,
to: :gitlab_subscription
,
allow_nil:
true
before_create
:sync_membership_lock_with_parent
...
...
@@ -106,6 +104,26 @@ module EE
before_save
:clear_feature_available_cache
after_commit
:sync_name_with_customers_dot
,
on: :update
,
if:
->
{
name_previously_changed?
&&
!
project_namespace?
}
def
temporary_storage_increase_enabled?
!!
namespace_limit
&
.
temporary_storage_increase_enabled?
end
def
eligible_for_temporary_storage_increase?
!!
namespace_limit
&
.
eligible_for_temporary_storage_increase?
end
def
trial?
!!
gitlab_subscription
&
.
trial?
end
def
upgradable?
!!
gitlab_subscription
&
.
upgradable?
end
def
trial_extended_or_reactivated?
!!
gitlab_subscription
&
.
trial_extended_or_reactivated?
end
end
# Only groups can be marked for deletion
...
...
ee/spec/requests/api/users_spec.rb
View file @
b861ed30
...
...
@@ -242,7 +242,7 @@ RSpec.describe API::Users do
it
'returns `nil` for both plan and trial'
do
get
api
(
"/users/
#{
user
.
id
}
"
,
admin
)
expect
(
json_response
).
to
include
(
'plan'
=>
nil
,
'trial'
=>
nil
)
expect
(
json_response
).
to
include
(
'plan'
=>
nil
,
'trial'
=>
false
)
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