Ok, thanks to everyone who's helped me out so far... so close to being done with the boring parts

I have documents that upload, and I need to associate a id that's in a session to the document. What I have in my model is:

Code:
class Document < ActiveRecord::Base
  ..

  def before_save
    self.project_id = session[:project_id]
    ..
  end
..
Basically, it's saying it's not available (undefined local variable or method `session' for #<Object:0x2799258>)

However, it's available in the controller. Is there something I should be doing to get it there? Maybe im just not sure why session is local to the controller and not the model...