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

This commit is contained in:
Andrey Kumanyaev 2012-12-26 14:17:53 +04:00
parent 2753cea75a
commit 1e3d238910
3 changed files with 7 additions and 7 deletions

View file

@ -68,8 +68,8 @@ class Admin::GroupsController < AdminController
end
def project_teams_update
@group.projects.each do |p|
p.add_users_ids_to_team(params[:user_ids], params[:project_access])
@group.projects.each do |project|
project.add_users_ids_to_team(params[:user_ids], params[:project_access])
end
redirect_to [:admin, @group], notice: 'Users was successfully added.'
end

View file

@ -59,8 +59,8 @@ class GroupsController < ApplicationController
end
def team_members
@group.projects.each do |p|
p.add_users_ids_to_team(params[:user_ids], params[:project_access])
@group.projects.each do |project|
project.add_users_ids_to_team(params[:user_ids], params[:project_access])
end
redirect_to people_group_path(@group), notice: 'Users was successfully added.'
end

View file

@ -76,9 +76,9 @@
%tr{class: "user_#{u.id}"}
%td.name= link_to u.name, admin_user_path(u)
%td.projects_access
- u.projects.in_group(@group).each do |p|
- u_p = u.users_projects.in_project(p).first
= "#{p.name} (#{link_to u_p.project_access_human, edit_admin_team_member_path(u_p) })".html_safe
- u.projects.in_group(@group).each do |project|
- u_p = u.users_projects.in_project(project).first
= "#{project.name} (#{link_to u_p.project_access_human, edit_admin_team_member_path(u_p) })".html_safe
%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= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3"}