fixed new user registration

This commit is contained in:
zmagod 2016-10-12 12:02:04 +02:00
parent 8cd86a50bb
commit 8f24d0d80c
2 changed files with 7 additions and 0 deletions

View file

@ -158,6 +158,10 @@ class Users::RegistrationsController < Devise::RegistrationsController
organization: @org,
role: :admin
)
# set current organization to new user
resource.current_organization_id = @org.id
resource.save
end
end

View file

@ -101,10 +101,12 @@
</li>
<!-- Global team switch -->
<% if current_user.organizations.length > 1 %>
<li class="dropdown" id="team-switch">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span><%= current_organization.name %></span>
</a>
<ul class="dropdown-menu ">
<%= form_for(current_user,
url: user_current_organization_path,
@ -117,6 +119,7 @@
<% end %>
</ul>
</li>
<% end %>
<!-- greetings -->
<li class="dropdown">