Commit 1e3d2389 authored by Andrey Kumanyaev's avatar Andrey Kumanyaev

Replace short loop variable from "p" to "project"

parent 2753cea7
...@@ -68,8 +68,8 @@ class Admin::GroupsController < AdminController ...@@ -68,8 +68,8 @@ class Admin::GroupsController < AdminController
end end
def project_teams_update def project_teams_update
@group.projects.each do |p| @group.projects.each do |project|
p.add_users_ids_to_team(params[:user_ids], params[:project_access]) project.add_users_ids_to_team(params[:user_ids], params[:project_access])
end end
redirect_to [:admin, @group], notice: 'Users was successfully added.' redirect_to [:admin, @group], notice: 'Users was successfully added.'
end end
......
...@@ -59,8 +59,8 @@ class GroupsController < ApplicationController ...@@ -59,8 +59,8 @@ class GroupsController < ApplicationController
end end
def team_members def team_members
@group.projects.each do |p| @group.projects.each do |project|
p.add_users_ids_to_team(params[:user_ids], params[:project_access]) project.add_users_ids_to_team(params[:user_ids], params[:project_access])
end end
redirect_to people_group_path(@group), notice: 'Users was successfully added.' redirect_to people_group_path(@group), notice: 'Users was successfully added.'
end end
......
...@@ -76,9 +76,9 @@ ...@@ -76,9 +76,9 @@
%tr{class: "user_#{u.id}"} %tr{class: "user_#{u.id}"}
%td.name= link_to u.name, admin_user_path(u) %td.name= link_to u.name, admin_user_path(u)
%td.projects_access %td.projects_access
- u.projects.in_group(@group).each do |p| - u.projects.in_group(@group).each do |project|
- u_p = u.users_projects.in_project(p).first - u_p = u.users_projects.in_project(project).first
= "#{p.name} (#{link_to u_p.project_access_human, edit_admin_team_member_path(u_p) })".html_safe = "#{project.name} (#{link_to u_p.project_access_human, edit_admin_team_member_path(u_p) })".html_safe
%tr %tr
%td.input= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true, data: {placeholder: 'Select users'}, class: 'chosen span5' %td.input= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true, data: {placeholder: 'Select users'}, class: 'chosen span5'
%td= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3"} %td= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3"}
......
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