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
Léo-Paul Géneau
gitlab-ce
Commits
53915c5c
Commit
53915c5c
authored
Mar 17, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alias secret_key and secret_value to key and value
parent
763c82f0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
+8
-12
app/controllers/groups/variables_controller.rb
app/controllers/groups/variables_controller.rb
+1
-6
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+1
-6
app/models/ci/group_variable.rb
app/models/ci/group_variable.rb
+3
-0
app/models/ci/variable.rb
app/models/ci/variable.rb
+3
-0
No files found.
app/controllers/groups/variables_controller.rb
View file @
53915c5c
...
@@ -35,12 +35,7 @@ module Groups
...
@@ -35,12 +35,7 @@ module Groups
end
end
def
group_variables_params
def
group_variables_params
filtered_params
=
params
.
permit
(
variables_attributes:
[
*
variable_params_attributes
])
params
.
permit
(
variables_attributes:
[
*
variable_params_attributes
])
filtered_params
[
"variables_attributes"
].
each
do
|
variable
|
variable
[
"key"
]
=
variable
.
delete
(
"secret_key"
)
variable
[
"value"
]
=
variable
.
delete
(
"secret_value"
)
end
filtered_params
end
end
def
variable_params_attributes
def
variable_params_attributes
...
...
app/controllers/projects/variables_controller.rb
View file @
53915c5c
...
@@ -32,12 +32,7 @@ class Projects::VariablesController < Projects::ApplicationController
...
@@ -32,12 +32,7 @@ class Projects::VariablesController < Projects::ApplicationController
end
end
def
variables_params
def
variables_params
filtered_params
=
params
.
permit
(
variables_attributes:
[
*
variable_params_attributes
])
params
.
permit
(
variables_attributes:
[
*
variable_params_attributes
])
filtered_params
[
"variables_attributes"
].
each
do
|
variable
|
variable
[
"key"
]
=
variable
.
delete
(
"secret_key"
)
variable
[
"value"
]
=
variable
.
delete
(
"secret_value"
)
end
filtered_params
end
end
def
variable_params_attributes
def
variable_params_attributes
...
...
app/models/ci/group_variable.rb
View file @
53915c5c
...
@@ -6,6 +6,9 @@ module Ci
...
@@ -6,6 +6,9 @@ module Ci
belongs_to
:group
belongs_to
:group
alias_attribute
:secret_key
,
:key
alias_attribute
:secret_value
,
:value
validates
:key
,
uniqueness:
{
validates
:key
,
uniqueness:
{
scope: :group_id
,
scope: :group_id
,
message:
"(%{value}) has already been taken"
message:
"(%{value}) has already been taken"
...
...
app/models/ci/variable.rb
View file @
53915c5c
...
@@ -6,6 +6,9 @@ module Ci
...
@@ -6,6 +6,9 @@ module Ci
belongs_to
:project
belongs_to
:project
alias_attribute
:secret_key
,
:key
alias_attribute
:secret_value
,
:value
validates
:key
,
uniqueness:
{
validates
:key
,
uniqueness:
{
scope:
[
:project_id
,
:environment_scope
],
scope:
[
:project_id
,
:environment_scope
],
message:
"(%{value}) has already been taken"
message:
"(%{value}) has already been taken"
...
...
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