app/controllers/organizations_controller.rb in artfully_ose-1.2.0 vs app/controllers/organizations_controller.rb in artfully_ose-1.3.0.pre1

- old
+ new

@@ -2,10 +2,15 @@ rescue_from CanCan::AccessDenied do |exception| flash[:alert] = exception.message redirect_to root_path end + before_filter do + @active_tab = params[:active_tab] + @ability ||= Ability.new(current_user) + end + def index if current_user.is_in_organization? redirect_to organization_url(current_user.current_organization) else redirect_to new_organization_url @@ -13,9 +18,12 @@ end def show @organization = Organization.find(params[:id]) authorize! :view, @organization + @kits = @organization.available_kits + @user_memberships = @organization.user_memberships.includes(:user, :organization) + @sorted_user_memberships = UserMembership.sort_by_permission(@user_memberships) end def new unless current_user.current_organization.new_record? flash[:error] = "You can only join one organization at this time."