Commit 4ff1fc35 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove attr_accessible from EE only models

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a74b66cd
...@@ -14,7 +14,7 @@ class Projects::GitHooksController < Projects::ApplicationController ...@@ -14,7 +14,7 @@ class Projects::GitHooksController < Projects::ApplicationController
def update def update
@pre_receive_hook = project.git_hook @pre_receive_hook = project.git_hook
@pre_receive_hook.update_attributes(params[:git_hook]) @pre_receive_hook.update_attributes(git_hook_params)
if @pre_receive_hook.valid? if @pre_receive_hook.valid?
redirect_to project_git_hooks_path(@project) redirect_to project_git_hooks_path(@project)
...@@ -22,4 +22,11 @@ class Projects::GitHooksController < Projects::ApplicationController ...@@ -22,4 +22,11 @@ class Projects::GitHooksController < Projects::ApplicationController
render :index render :index
end end
end end
private
# Only allow a trusted parameter "white list" through.
def git_hook_params
params.require(:git_hook).permit(:deny_delete_tag, :delete_branch_regex, :commit_message_regex, :force_push_regex)
end
end end
...@@ -40,7 +40,7 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -40,7 +40,7 @@ class Projects::ServicesController < Projects::ApplicationController
def service_params def service_params
params.require(:service).permit( params.require(:service).permit(
:title, :token, :type, :active, :api_key, :subdomain, :title, :token, :type, :active, :api_key, :subdomain,
:room, :recipients, :project_url :room, :recipients, :project_url, :username, :password, :api_version
) )
end end
end end
class Appearance < ActiveRecord::Base class Appearance < ActiveRecord::Base
attr_accessible :title, :description, :logo
validates :title, presence: true validates :title, presence: true
validates :description, presence: true validates :description, presence: true
validates :logo, file_size: { maximum: 1000.kilobytes.to_i } validates :logo, file_size: { maximum: 1000.kilobytes.to_i }
......
class GitHook < ActiveRecord::Base class GitHook < ActiveRecord::Base
attr_accessible :deny_delete_tag, :delete_branch_regex, :commit_message_regex, :force_push_regex
belongs_to :project belongs_to :project
validates :project, presence: true validates :project, presence: true
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
# #
class JenkinsService < CiService class JenkinsService < CiService
attr_accessible :project_url
validates :project_url, presence: true, if: :activated? validates :project_url, presence: true, if: :activated?
delegate :execute, to: :service_hook, prefix: nil delegate :execute, to: :service_hook, prefix: nil
......
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
# api_version :string(255) # api_version :string(255)
class JiraService < Service class JiraService < Service
include HTTParty include HTTParty
attr_accessible :project_url, :username, :password, :api_version
validates :username, :password, presence: true, if: :activated? validates :username, :password, presence: true, if: :activated?
before_validation :set_api_version before_validation :set_api_version
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment