Remove attr_accessible from EE only models

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets
2014-07-11 14:38:56 +03:00
parent a74b66cdee
commit 4ff1fc35d4
6 changed files with 9 additions and 10 deletions
@@ -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
-2
View File
@@ -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 }
-2
View File
@@ -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