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
Tatuya Kamada
gitlab-ce
Commits
3a21c904
Commit
3a21c904
authored
Jun 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strong params for 5 more models
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
04516027
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
16 deletions
+20
-16
app/controllers/admin/broadcast_messages_controller.rb
app/controllers/admin/broadcast_messages_controller.rb
+8
-1
app/controllers/projects/protected_branches_controller.rb
app/controllers/projects/protected_branches_controller.rb
+7
-1
app/controllers/users_groups_controller.rb
app/controllers/users_groups_controller.rb
+5
-1
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+0
-2
app/models/deploy_keys_project.rb
app/models/deploy_keys_project.rb
+0
-3
app/models/forked_project_link.rb
app/models/forked_project_link.rb
+0
-4
app/models/protected_branch.rb
app/models/protected_branch.rb
+0
-2
app/models/users_group.rb
app/models/users_group.rb
+0
-2
No files found.
app/controllers/admin/broadcast_messages_controller.rb
View file @
3a21c904
...
@@ -6,7 +6,7 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
...
@@ -6,7 +6,7 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
end
end
def
create
def
create
@broadcast_message
=
BroadcastMessage
.
new
(
params
[
:broadcast_message
]
)
@broadcast_message
=
BroadcastMessage
.
new
(
broadcast_message_params
)
if
@broadcast_message
.
save
if
@broadcast_message
.
save
redirect_to
admin_broadcast_messages_path
,
notice:
'Broadcast Message was successfully created.'
redirect_to
admin_broadcast_messages_path
,
notice:
'Broadcast Message was successfully created.'
...
@@ -29,4 +29,11 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
...
@@ -29,4 +29,11 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
def
broadcast_messages
def
broadcast_messages
@broadcast_messages
||=
BroadcastMessage
.
order
(
"starts_at DESC"
).
page
(
params
[
:page
])
@broadcast_messages
||=
BroadcastMessage
.
order
(
"starts_at DESC"
).
page
(
params
[
:page
])
end
end
def
broadcast_message_params
params
.
require
(
:broadcast_message
).
permit
(
:alert_type
,
:color
,
:ends_at
,
:font
,
:message
,
:starts_at
)
end
end
end
app/controllers/projects/protected_branches_controller.rb
View file @
3a21c904
...
@@ -11,7 +11,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
...
@@ -11,7 +11,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
end
end
def
create
def
create
@project
.
protected_branches
.
create
(
p
arams
[
:protected_branch
]
)
@project
.
protected_branches
.
create
(
p
rotected_branch_params
)
redirect_to
project_protected_branches_path
(
@project
)
redirect_to
project_protected_branches_path
(
@project
)
end
end
...
@@ -23,4 +23,10 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
...
@@ -23,4 +23,10 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
format
.
js
{
render
nothing:
true
}
format
.
js
{
render
nothing:
true
}
end
end
end
end
private
def
protected_branch_params
params
.
require
(
:protected_branch
).
permit
(
:name
)
end
end
end
app/controllers/users_groups_controller.rb
View file @
3a21c904
...
@@ -14,7 +14,7 @@ class UsersGroupsController < ApplicationController
...
@@ -14,7 +14,7 @@ class UsersGroupsController < ApplicationController
def
update
def
update
@member
=
@group
.
users_groups
.
find
(
params
[
:id
])
@member
=
@group
.
users_groups
.
find
(
params
[
:id
])
@member
.
update_attributes
(
params
[
:users_group
]
)
@member
.
update_attributes
(
member_params
)
end
end
def
destroy
def
destroy
...
@@ -41,4 +41,8 @@ class UsersGroupsController < ApplicationController
...
@@ -41,4 +41,8 @@ class UsersGroupsController < ApplicationController
return
render_404
return
render_404
end
end
end
end
def
member_params
params
.
require
(
:users_group
).
permit
(
:group_access
,
:user_id
)
end
end
end
app/models/broadcast_message.rb
View file @
3a21c904
...
@@ -14,8 +14,6 @@
...
@@ -14,8 +14,6 @@
#
#
class
BroadcastMessage
<
ActiveRecord
::
Base
class
BroadcastMessage
<
ActiveRecord
::
Base
attr_accessible
:alert_type
,
:color
,
:ends_at
,
:font
,
:message
,
:starts_at
validates
:message
,
presence:
true
validates
:message
,
presence:
true
validates
:starts_at
,
presence:
true
validates
:starts_at
,
presence:
true
validates
:ends_at
,
presence:
true
validates
:ends_at
,
presence:
true
...
...
app/models/deploy_keys_project.rb
View file @
3a21c904
...
@@ -10,13 +10,10 @@
...
@@ -10,13 +10,10 @@
#
#
class
DeployKeysProject
<
ActiveRecord
::
Base
class
DeployKeysProject
<
ActiveRecord
::
Base
attr_accessible
:key_id
,
:project_id
belongs_to
:project
belongs_to
:project
belongs_to
:deploy_key
belongs_to
:deploy_key
validates
:deploy_key_id
,
presence:
true
validates
:deploy_key_id
,
presence:
true
validates
:deploy_key_id
,
uniqueness:
{
scope:
[
:project_id
],
message:
"already exists in project"
}
validates
:deploy_key_id
,
uniqueness:
{
scope:
[
:project_id
],
message:
"already exists in project"
}
validates
:project_id
,
presence:
true
validates
:project_id
,
presence:
true
end
end
app/models/forked_project_link.rb
View file @
3a21c904
...
@@ -10,10 +10,6 @@
...
@@ -10,10 +10,6 @@
#
#
class
ForkedProjectLink
<
ActiveRecord
::
Base
class
ForkedProjectLink
<
ActiveRecord
::
Base
attr_accessible
:forked_from_project_id
,
:forked_to_project_id
# Relations
belongs_to
:forked_to_project
,
class_name:
Project
belongs_to
:forked_to_project
,
class_name:
Project
belongs_to
:forked_from_project
,
class_name:
Project
belongs_to
:forked_from_project
,
class_name:
Project
end
end
app/models/protected_branch.rb
View file @
3a21c904
...
@@ -12,8 +12,6 @@
...
@@ -12,8 +12,6 @@
class
ProtectedBranch
<
ActiveRecord
::
Base
class
ProtectedBranch
<
ActiveRecord
::
Base
include
Gitlab
::
ShellAdapter
include
Gitlab
::
ShellAdapter
attr_accessible
:name
belongs_to
:project
belongs_to
:project
validates
:name
,
presence:
true
validates
:name
,
presence:
true
validates
:project
,
presence:
true
validates
:project
,
presence:
true
...
...
app/models/users_group.rb
View file @
3a21c904
...
@@ -19,8 +19,6 @@ class UsersGroup < ActiveRecord::Base
...
@@ -19,8 +19,6 @@ class UsersGroup < ActiveRecord::Base
Gitlab
::
Access
.
options_with_owner
Gitlab
::
Access
.
options_with_owner
end
end
attr_accessible
:group_access
,
:user_id
belongs_to
:user
belongs_to
:user
belongs_to
:group
belongs_to
:group
...
...
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