static public Method

ActiveRecordStore.new(session, option = nil)

Find or instantiate a session given a CGI::Session.

Source Code

# File action_controller/session/active_record_store.rb, line 286
def initialize(session, option = nil)
  session_id = session.session_id
  unless @session = ActiveRecord::Base.silence { @@session_class.find_by_session_id(session_id) }
    unless session.new_session
      raise CGI::Session::NoSession, 'uninitialized session'
    end
    @session = @@session_class.new(:session_id => session_id, :data => {})
    # session saving can be lazy again, because of improved component implementation
    # therefore next line gets commented out:
    # @session.save
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.