mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-26 04:56:16 +10:00
Remove attr_accessible from EE only models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
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 }
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user