Skip to content
Snippets Groups Projects
Verified Commit e382c8df authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

team member and hook strong params

parent f86afb73
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -12,7 +12,7 @@ class Projects::HooksController < Projects::ApplicationController
end
 
def create
@hook = @project.hooks.new(params[:hook])
@hook = @project.hooks.new(hook_params)
@hook.save
 
if @hook.valid?
Loading
Loading
@@ -40,4 +40,8 @@ class Projects::HooksController < Projects::ApplicationController
def hook
@hook ||= @project.hooks.find(params[:id])
end
def hook_params
params.require(:hook).permit(:url)
end
end
Loading
Loading
@@ -27,7 +27,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
 
def update
@user_project_relation = project.users_projects.find_by(user_id: member)
@user_project_relation.update_attributes(params[:team_member])
@user_project_relation.update_attributes(member_params)
 
unless @user_project_relation.valid?
flash[:alert] = "User should have at least one role"
Loading
Loading
@@ -67,4 +67,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
def member
@member ||= User.find_by(username: params[:id])
end
def member_params
params.require(:team_member).permit(:user_id, :project_access)
end
end
Loading
Loading
@@ -16,8 +16,6 @@ class UsersProject < ActiveRecord::Base
include Notifiable
include Gitlab::Access
 
#attr_accessible :user, :user_id, :project_access
belongs_to :user
belongs_to :project
 
Loading
Loading
Loading
Loading
@@ -22,8 +22,6 @@ class WebHook < ActiveRecord::Base
default_value_for :issues_events, false
default_value_for :merge_requests_events, false
 
#attr_accessible :url
# HTTParty timeout
default_timeout 10
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment