diff options
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/session/active_record_store.rb | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 4cb8c11588..067dcacca6 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -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 < StandardError #:nodoc: @@ -846,8 +847,7 @@ module ActionController #:nodoc: end def self.action_methods - #puts "action method: #{public_instance_methods.inspect}" - @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 --git a/actionpack/lib/action_controller/session/active_record_store.rb b/actionpack/lib/action_controller/session/active_record_store.rb index a653947038..90a84511be 100644 --- a/actionpack/lib/action_controller/session/active_record_store.rb +++ b/actionpack/lib/action_controller/session/active_record_store.rb @@ -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, &block) + if model then model.send(method, *args, &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 |