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
3b2f0928
Commit
3b2f0928
authored
Jul 07, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Name as variable_params like project variable controller
parent
474d25e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
app/controllers/groups/variables_controller.rb
app/controllers/groups/variables_controller.rb
+10
-6
No files found.
app/controllers/groups/variables_controller.rb
View file @
3b2f0928
...
...
@@ -11,7 +11,7 @@ module Groups
end
def
update
if
variable
.
update
(
group
_params
)
if
variable
.
update
(
variable
_params
)
redirect_to
group_variables_path
(
group
),
notice:
'Variable was successfully updated.'
else
...
...
@@ -20,7 +20,7 @@ module Groups
end
def
create
@variable
=
group
.
variables
.
create
(
group
_params
)
@variable
=
group
.
variables
.
create
(
variable
_params
)
.
present
(
current_user:
current_user
)
if
@variable
.
persisted?
...
...
@@ -45,16 +45,20 @@ module Groups
private
def
authorize_admin_build!
return
render_404
unless
can?
(
current_user
,
:admin_build
,
group
)
def
variable_params
params
.
require
(
:variable
).
permit
(
*
variable_params_attributes
)
end
def
group_param
s
params
.
require
(
:variable
).
permit
([
:key
,
:value
,
:protected
])
def
variable_params_attribute
s
%i[key value protected]
end
def
variable
@variable
||=
group
.
variables
.
find
(
params
[
:id
]).
present
(
current_user:
current_user
)
end
def
authorize_admin_build!
return
render_404
unless
can?
(
current_user
,
:admin_build
,
group
)
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