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
04516027
Commit
04516027
authored
Jun 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Project services to strong params
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1dab1594
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
16 deletions
+8
-16
app/controllers/projects/services_controller.rb
app/controllers/projects/services_controller.rb
+8
-1
app/models/project_services/assembla_service.rb
app/models/project_services/assembla_service.rb
+0
-2
app/models/project_services/campfire_service.rb
app/models/project_services/campfire_service.rb
+0
-2
app/models/project_services/emails_on_push_service.rb
app/models/project_services/emails_on_push_service.rb
+0
-2
app/models/project_services/gitlab_ci_service.rb
app/models/project_services/gitlab_ci_service.rb
+0
-2
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+0
-2
app/models/project_services/slack_service.rb
app/models/project_services/slack_service.rb
+0
-3
app/models/service.rb
app/models/service.rb
+0
-2
No files found.
app/controllers/projects/services_controller.rb
View file @
04516027
...
...
@@ -16,7 +16,7 @@ class Projects::ServicesController < Projects::ApplicationController
end
def
update
if
@service
.
update_attributes
(
params
[
:service
]
)
if
@service
.
update_attributes
(
service_params
)
redirect_to
edit_project_service_path
(
@project
,
@service
.
to_param
)
else
render
'edit'
...
...
@@ -36,4 +36,11 @@ class Projects::ServicesController < Projects::ApplicationController
def
service
@service
||=
@project
.
services
.
find
{
|
service
|
service
.
to_param
==
params
[
:id
]
}
end
def
service_params
params
.
require
(
:service
).
permit
(
:title
,
:token
,
:type
,
:active
,
:api_key
,
:subdomain
,
:room
,
:recipients
,
:project_url
)
end
end
app/models/project_services/assembla_service.rb
View file @
04516027
...
...
@@ -18,8 +18,6 @@
#
class
AssemblaService
<
Service
attr_accessible
:subdomain
include
HTTParty
validates
:token
,
presence:
true
,
if: :activated?
...
...
app/models/project_services/campfire_service.rb
View file @
04516027
...
...
@@ -18,8 +18,6 @@
#
class
CampfireService
<
Service
attr_accessible
:subdomain
,
:room
validates
:token
,
presence:
true
,
if: :activated?
def
title
...
...
app/models/project_services/emails_on_push_service.rb
View file @
04516027
...
...
@@ -18,8 +18,6 @@
#
class
EmailsOnPushService
<
Service
attr_accessible
:recipients
validates
:recipients
,
presence:
true
,
if: :activated?
def
title
...
...
app/models/project_services/gitlab_ci_service.rb
View file @
04516027
...
...
@@ -18,8 +18,6 @@
#
class
GitlabCiService
<
CiService
attr_accessible
:project_url
validates
:project_url
,
presence:
true
,
if: :activated?
validates
:token
,
presence:
true
,
if: :activated?
...
...
app/models/project_services/hipchat_service.rb
View file @
04516027
...
...
@@ -18,8 +18,6 @@
#
class
HipchatService
<
Service
attr_accessible
:room
validates
:token
,
presence:
true
,
if: :activated?
def
title
...
...
app/models/project_services/slack_service.rb
View file @
04516027
...
...
@@ -18,9 +18,6 @@
#
class
SlackService
<
Service
attr_accessible
:room
attr_accessible
:subdomain
validates
:room
,
presence:
true
,
if: :activated?
validates
:subdomain
,
presence:
true
,
if: :activated?
validates
:token
,
presence:
true
,
if: :activated?
...
...
app/models/service.rb
View file @
04516027
...
...
@@ -22,8 +22,6 @@
class
Service
<
ActiveRecord
::
Base
default_value_for
:active
,
false
attr_accessible
:title
,
:token
,
:type
,
:active
,
:api_key
belongs_to
:project
has_one
:service_hook
...
...
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