Displaying 1 result from an estimated 1 matches for "export_session_to_model".
Did you mean:
export_session_to_models
2006 Apr 06
7
LoginSystem : make @session available to models
...added to ActiveRecord::Base doesn''t break when several users
use the application, leading to multiple sessions.
First, let controllers give @session to models :
(In controllers/application.rb)
class ApplicationController < ActionController::Base
include LoginSystem
before_filter :export_session_to_models
def export_session_to_models
ActiveRecord::Base.set_session { @session }
end
end
Now, let models know the set_session method, and let''s define
ActiveRecord::Base::session:
(In controllers/application.rb)
# This unless is required for proper behavior in FastCGI context
unless de...