Getting the Session from a Model

# creates a new content object from the params sent by the upload form content = Content.new(params[:content]) # adds the user association, this assumes the user OBBJECT is stored in session content.user = session[:user] # save the new Content object content.save!