I tried this approach but I'm having a problem in that where I'm storing the default value isn't available in the model.
I'm basically duplicating the @current_user code and setting a @current_project session variable via a before_filter in the ApplicationControler.
In my Sample model I have the following code
after_initialize :init
def init
self.project_id ||= @current_project
end
However @current_project is nil. It's not set. I've even tried to directly access the session via session[:project] but that also throws a nil value exception and debugging show the session doesn't exist at this point of execution.
Bob