Merge pull request #244 from ZmagoD/zd_SCI_608

sets current organization id as a current user first organization if is the case that the current_organization is not present  [fixes SCI-608]
This commit is contained in:
Zmago Devetak 2016-10-25 09:16:27 +02:00 committed by GitHub
commit 2cae847411
2 changed files with 5 additions and 1 deletions

View file

@ -30,7 +30,9 @@ class ProjectsController < ApplicationController
end
if current_user.organizations.any?
@current_organization_id = current_organization.id
@current_organization_id = current_organization.id if current_organization
@current_organization_id ||= current_user.organizations.first.id
@current_sort = params[:sort].to_s
@projects_by_orgs = current_user
.projects_by_orgs(@current_organization_id,

View file

@ -87,7 +87,9 @@
</li>
<% end %>
<% end %>
<% if current_user.organizations.length > 1 %>
<li role="separator" class="divider"></li>
<% end %>
<li>
<%= link_to new_organization_path do %>
<span class="glyphicon glyphicon-plus"></span>