<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *SVN*
 
+* Expose the session model backing CGI::Session
+
 * Abbreviate RAILS_ROOT in traces
 
 </diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ require 'action_controller/routing'
 require 'action_controller/code_generation'
 require 'action_controller/url_rewriter'
 require 'drb'
+require 'set'
 
 module ActionController #:nodoc:
   class ActionControllerError &lt; StandardError #:nodoc:
@@ -846,8 +847,7 @@ module ActionController #:nodoc:
       end
 
       def self.action_methods
-        #puts &quot;action method: #{public_instance_methods.inspect}&quot;
-        @action_methods ||= (public_instance_methods - hidden_actions).inject({}) { |h, k| h[k] = true; h }
+        @action_methods ||= Set.new(public_instance_methods - hidden_actions)
       end
 
       def add_variables_to_assigns</diff>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,16 @@ require 'base64'
 
 class CGI
   class Session
+    # Return this session's underlying Session model. Useful for the DB-backed session stores.
+    def model
+      @dbman.model rescue nil
+    end
+
+    # Proxy missing methods to the underlying Session model.
+    def method_missing(method, *args, &amp;block)
+      if model then model.send(method, *args, &amp;block) else super end
+    end
+
     # A session store backed by an Active Record class.
     #
     # A default class is provided, but any object duck-typing to an Active
@@ -277,6 +287,11 @@ class CGI
         end
       end
 
+      # Access the underlying session model.
+      def model
+        @session
+      end
+
       # Restore session state.  The session model handles unmarshaling.
       def restore
         if @session</diff>
      <filename>actionpack/lib/action_controller/session/active_record_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,7 +53,6 @@ module CommonActiveRecordStoreTests
       @new_session.close
     end
   end
-
 end
 
 class ActiveRecordStoreTest &lt; Test::Unit::TestCase
@@ -73,13 +72,17 @@ class ActiveRecordStoreTest &lt; Test::Unit::TestCase
     @new_session['foo'] = 'bar'
   end
 
+  def test_model_attribute
+    assert_kind_of CGI::Session::ActiveRecordStore::Session, @new_session.model
+    assert_equal @new_session.model.data, @new_session.data
+  end
+
   def teardown
     session_class.drop_table!
   end
 end
 
 class ColumnLimitTest &lt; Test::Unit::TestCase
-
   def setup
     @session_class = CGI::Session::ActiveRecordStore::Session
     @session_class.create_table!
@@ -97,10 +100,8 @@ class ColumnLimitTest &lt; Test::Unit::TestCase
     s.data
     assert_raises(ActionController::SessionOverflowError) { s.save }
   end
-
 end
 
-
 class DeprecatedActiveRecordStoreTest &lt; ActiveRecordStoreTest
   def setup
     session_class.connection.execute 'create table old_sessions (id integer primary key, sessid text unique, data text)'
@@ -128,12 +129,17 @@ class SqlBypassActiveRecordStoreTest &lt; ActiveRecordStoreTest
     end
     @session_class
   end
+
+  def test_model_attribute
+    assert_kind_of CGI::Session::ActiveRecordStore::SqlBypass, @new_session.model
+    assert_equal @new_session.model.data, @new_session.data
+  end
 end
 
 
 # End of safety net.
   rescue Object =&gt; e
-    $stderr.puts &quot;Skipping CGI::Session::ActiveRecordStore tests: #{e}&quot;    
+    $stderr.puts &quot;Skipping CGI::Session::ActiveRecordStore tests: #{e}&quot;
     #$stderr.puts &quot;  #{e.backtrace.join(&quot;\n  &quot;)}&quot;
   end
 end</diff>
      <filename>actionpack/test/controller/active_record_store_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,7 +67,11 @@ class ControllerInstanceTests &lt; Test::Unit::TestCase
   end
 
   def test_action_methods
-    @empty_controllers.each {|c| assert_equal({}, c.send(:action_methods), &quot;#{c.class.controller_path} should be empty!&quot;)}
-    @non_empty_controllers.each {|c| assert_equal({&quot;public_action&quot;=&gt;true}, c.send(:action_methods), &quot;#{c.class.controller_path} should not be empty!&quot;)}
+    @empty_controllers.each do |c|
+      assert_equal Set.new, c.send(:action_methods), &quot;#{c.class.controller_path} should be empty!&quot;
+    end
+    @non_empty_controllers.each do |c|
+      assert_equal Set.new('public_action'), c.send(:action_methods), &quot;#{c.class.controller_path} should not be empty!&quot;
+    end
   end
 end</diff>
      <filename>actionpack/test/controller/base_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5f0b9369cc857ef007a9b0f573b63225e342e4fd</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/22d9bad8a038eef751e1270f204211cca3c8af18</url>
  <id>22d9bad8a038eef751e1270f204211cca3c8af18</id>
  <committed-date>2005-10-20T14:59:48-07:00</committed-date>
  <authored-date>2005-10-20T14:59:48-07:00</authored-date>
  <message>Expose the session model backing CGI::Session

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2696 5ecf4fe2-1ee6-0310-87b1-e25e094e27de</message>
  <tree>27064e135142b4f49f27b242ab98b409fe551e38</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
