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
Boxiang Sun
gitlab-ce
Commits
4319b15a
Commit
4319b15a
authored
Feb 15, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Condition associated variable validation in Project and Group
parent
44fed816
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
app/models/group.rb
app/models/group.rb
+2
-1
app/models/project.rb
app/models/project.rb
+1
-1
No files found.
app/models/group.rb
View file @
4319b15a
...
@@ -26,7 +26,7 @@ class Group < Namespace
...
@@ -26,7 +26,7 @@ class Group < Namespace
has_many
:shared_projects
,
through: :project_group_links
,
source: :project
has_many
:shared_projects
,
through: :project_group_links
,
source: :project
has_many
:notification_settings
,
dependent: :destroy
,
as: :source
# rubocop:disable Cop/ActiveRecordDependent
has_many
:notification_settings
,
dependent: :destroy
,
as: :source
# rubocop:disable Cop/ActiveRecordDependent
has_many
:labels
,
class_name:
'GroupLabel'
has_many
:labels
,
class_name:
'GroupLabel'
has_many
:variables
,
class_name:
'Ci::GroupVariable'
,
validate:
false
has_many
:variables
,
class_name:
'Ci::GroupVariable'
has_many
:custom_attributes
,
class_name:
'GroupCustomAttribute'
has_many
:custom_attributes
,
class_name:
'GroupCustomAttribute'
has_many
:uploads
,
as: :model
,
dependent: :destroy
# rubocop:disable Cop/ActiveRecordDependent
has_many
:uploads
,
as: :model
,
dependent: :destroy
# rubocop:disable Cop/ActiveRecordDependent
...
@@ -37,6 +37,7 @@ class Group < Namespace
...
@@ -37,6 +37,7 @@ class Group < Namespace
validate
:visibility_level_allowed_by_sub_groups
validate
:visibility_level_allowed_by_sub_groups
validate
:visibility_level_allowed_by_parent
validate
:visibility_level_allowed_by_parent
validates
:variables
,
variable_duplicates:
true
validates
:variables
,
variable_duplicates:
true
validates_associated
:variables
,
if:
proc
{
|
group
|
group
.
errors
[
:variables
].
nil?
}
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
...
...
app/models/project.rb
View file @
4319b15a
...
@@ -210,7 +210,7 @@ class Project < ActiveRecord::Base
...
@@ -210,7 +210,7 @@ class Project < ActiveRecord::Base
has_many
:build_trace_section_names
,
class_name:
'Ci::BuildTraceSectionName'
has_many
:build_trace_section_names
,
class_name:
'Ci::BuildTraceSectionName'
has_many
:runner_projects
,
class_name:
'Ci::RunnerProject'
has_many
:runner_projects
,
class_name:
'Ci::RunnerProject'
has_many
:runners
,
through: :runner_projects
,
source: :runner
,
class_name:
'Ci::Runner'
has_many
:runners
,
through: :runner_projects
,
source: :runner
,
class_name:
'Ci::Runner'
has_many
:variables
,
class_name:
'Ci::Variable'
,
validate:
false
has_many
:variables
,
class_name:
'Ci::Variable'
has_many
:triggers
,
class_name:
'Ci::Trigger'
has_many
:triggers
,
class_name:
'Ci::Trigger'
has_many
:environments
has_many
:environments
has_many
:deployments
has_many
:deployments
...
...
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