Skip to content

Commit ca752e6

Browse files
committed
Fix mispelling and ambiguous id in UserTeam.without_project
1 parent ca105d0 commit ca752e6

File tree

8 files changed

+6
-13
lines changed

8 files changed

+6
-13
lines changed

app/controllers/projects/teams_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class Projects::TeamsController < Projects::ApplicationController
22

3-
def avaliable
3+
def available
44
@teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams
55
@teams = @teams.without_project(project)
66
unless @teams.any?

app/models/user_team.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class UserTeam < ActiveRecord::Base
1717

1818
scope :with_member, ->(user){ joins(:user_team_user_relationships).where(user_team_user_relationships: {user_id: user.id}) }
1919
scope :with_project, ->(project){ joins(:user_team_project_relationships).where(user_team_project_relationships: {project_id: project})}
20-
scope :without_project, ->(project){ where("id NOT IN (:ids)", ids: (a = with_project(project); a.blank? ? 0 : a))}
20+
scope :without_project, ->(project){ where("user_teams.id NOT IN (:ids)", ids: (a = with_project(project); a.blank? ? 0 : a))}
2121
scope :created_by, ->(user){ where(owner_id: user) }
2222

2323
class << self

app/views/dashboard/_teams.html.haml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
.teams_box
22
%h5.title
3-
My Teams
3+
Teams
44
%small
55
(#{@teams.count})
66
%span.right
77
= link_to new_team_path, class: "btn very_small info" do
88
%i.icon-plus
99
New Team
10-
%span.right
11-
= link_to teams_path, class: "btn very_small info" do
12-
%i.icon-user
13-
All Teams
1410
%ul.well-list
1511
- @teams.each do |team|
1612
%li

app/views/layouts/_head_panel.html.haml

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
%span.separator
99
%h1.project_name= title
1010
%ul.nav
11-
%li
12-
= link_to teams_path, title: "Teams of users", class: 'has_bottom_tooltip', 'data-original-title' => 'Teams list' do
13-
%i.icon-group
1411
- if current_user.is_admin?
1512
%li
1613
= link_to admin_root_path, title: "Admin area", class: 'has_bottom_tooltip', 'data-original-title' => 'Admin area' do

app/views/team_members/index.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
%span.right
1111
= link_to import_project_team_members_path(@project), class: "btn small grouped", title: "Import team from another project" do
1212
Import team from another project
13-
= link_to avaliable_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do
13+
= link_to available_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do
1414
Assign project to Team of users
1515
= link_to new_project_team_member_path(@project), class: "btn success small grouped", title: "New Team Member" do
1616
New Team Member

app/views/teams/new.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
= f.label :name do
99
Team name is
1010
.input
11-
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
11+
= f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left"
1212
&nbsp;
1313
= f.submit 'Create team', class: "btn primary"
1414
%hr

config/routes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
scope module: :projects do
273273
resources :teams, only: [] do
274274
collection do
275-
get :avaliable
275+
get :available
276276
post :assign
277277
end
278278
member do

0 commit comments

Comments
 (0)