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
2dd9a9af
Commit
2dd9a9af
authored
Jul 04, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix variables_controller.rb and format
parent
d228662f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
app/controllers/groups/variables_controller.rb
app/controllers/groups/variables_controller.rb
+1
-2
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+8
-6
No files found.
app/controllers/groups/variables_controller.rb
View file @
2dd9a9af
...
...
@@ -46,8 +46,7 @@ module Groups
end
def
group_params
params
.
require
(
:variable
)
.
permit
([
:key
,
:value
,
:protected
])
params
.
require
(
:variable
).
permit
([
:key
,
:value
,
:protected
])
end
def
variable
...
...
app/controllers/projects/variables_controller.rb
View file @
2dd9a9af
...
...
@@ -13,18 +13,21 @@ class Projects::VariablesController < Projects::ApplicationController
def
update
if
@variable
.
update
(
project_params
)
redirect_to
namespace_project_variables_path
(
project
.
namespace
,
project
),
notice:
'Variable was successfully updated.'
redirect_to
namespace_project_variables_path
(
project
.
namespace
,
project
),
notice:
'Variable was successfully updated.'
else
render
"show"
end
end
def
create
@
variable
=
Ci
::
Variable
.
new
(
project_params
)
new_
variable
=
Ci
::
Variable
.
new
(
project_params
)
if
@variable
.
valid?
&&
@project
.
variables
<<
@variable
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
notice:
'Variables were successfully updated.'
if
new_variable
.
valid?
&&
@project
.
variables
<<
new_variable
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
notice:
'Variables were successfully updated.'
else
@variable
=
new_variable
.
present
(
current_user:
current_user
)
render
"show"
end
end
...
...
@@ -40,8 +43,7 @@ class Projects::VariablesController < Projects::ApplicationController
private
def
project_params
params
.
require
(
:variable
)
.
permit
([
:id
,
:key
,
:value
,
:protected
,
:_destroy
])
params
.
require
(
:variable
).
permit
([
:id
,
:key
,
:value
,
:protected
,
:_destroy
])
end
def
variable
...
...
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