Commit d177abb3 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Refactor method that shares project with a group

parent f2e38681
...@@ -10,10 +10,9 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -10,10 +10,9 @@ class Projects::GroupLinksController < Projects::ApplicationController
group = Group.find(params[:link_group_id]) group = Group.find(params[:link_group_id])
if can?(current_user, :read_group, group) if can?(current_user, :read_group, group)
link = project.project_group_links.new project.project_group_links.create(
link.group_id = params[:link_group_id] group: group, group_access: params[:link_group_access]
link.group_access = params[:link_group_access] )
link.save
else else
return render_404 return render_404
end end
......
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