app/controllers/dashboard_controller.rb
# User request to change to a different eligible group
User request to change to a different eligible group
User request to change to a different eligible group
def change_group
    db_user = current_user
    db_user.update_attributes(:current_group => MiqGroup.find_by_id(params[:to_group]))
    session_reset
    session_init(db_user)
    session[:group_changed] = true
    url = start_url_for_user(nil) || url_for(:controller => params[:controller], :action => 'show')
    render :update do |page|
      page.redirect_to(url)
    end
  end
def change_group db_user = current_user db_user . update_attributes ( :current_group => MiqGroup . find_by_id ( params [ :to_group ] ) ) session_reset session_init ( db_user ) session [ :group_changed ] = true url = start_url_for_user ( nil ) || url_for ( :controller => params [ :controller ] , :action => 'show' ) render :update do | page | page . redirect_to ( url ) end end
User request to change to a different eligible group
User request to change to a different eligible group
# Get the user and new group and set current_group in the user record # Rebuild the session