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
def update
@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?
redirect_to project_git_hooks_path(@project)
......@@ -22,4 +22,11 @@ class Projects::GitHooksController < Projects::ApplicationController
render :index
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
......@@ -40,7 +40,7 @@ class Projects::ServicesController < Projects::ApplicationController
def service_params
params.require(:service).permit(
:title, :token, :type, :active, :api_key, :subdomain,
:room, :recipients, :project_url
:room, :recipients, :project_url, :username, :password, :api_version
)
end
end
class Appearance < ActiveRecord::Base
attr_accessible :title, :description, :logo
validates :title, presence: true
validates :description, presence: true
validates :logo, file_size: { maximum: 1000.kilobytes.to_i }
......
class GitHook < ActiveRecord::Base
attr_accessible :deny_delete_tag, :delete_branch_regex, :commit_message_regex, :force_push_regex
belongs_to :project
validates :project, presence: true
......
......@@ -18,8 +18,6 @@
#
class JenkinsService < CiService
attr_accessible :project_url
validates :project_url, presence: true, if: :activated?
delegate :execute, to: :service_hook, prefix: nil
......
......@@ -20,9 +20,7 @@
# api_version :string(255)
class JiraService < Service
include HTTParty
attr_accessible :project_url, :username, :password, :api_version
validates :username, :password, presence: true, if: :activated?
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