diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-06-26 20:45:41 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-06-26 20:45:41 +0000 |
commit | 08d23d5375fef67cb3203dfb5e92f41ae87195ee (patch) | |
tree | 977b5a608052564f609ff7153fe9a3ed52b63e93 /actionpack | |
parent | a72fe4ea45a94a09a8c31377fad935af6465b700 (diff) | |
download | rails-08d23d5375fef67cb3203dfb5e92f41ae87195ee.tar.gz rails-08d23d5375fef67cb3203dfb5e92f41ae87195ee.tar.bz2 rails-08d23d5375fef67cb3203dfb5e92f41ae87195ee.zip |
Allow sweepers to be created solely for expiring after controller actions, not model changes [DHH] Added assigns method to ActionController::Caching::Sweeper to easily access instance variables on the controller [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7128 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 3fd9a7dba8..9001ffb7fb 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,9 @@ *SVN* +* Allow sweepers to be created solely for expiring after controller actions, not model changes [DHH] + +* Added assigns method to ActionController::Caching::Sweeper to easily access instance variables on the controller [DHH] + * Give the legacy X-POST_DATA_FORMAT header greater precedence during params parsing for backward compatibility. [Jeremy Kemper] * Fixed that link_to with an href of # when using :method will not allow for click-through without JavaScript #7037 [stevenbristol/josh] diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index f9f3c37c1c..75aa9df812 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -636,6 +636,11 @@ module ActionController #:nodoc: ActionController::Caching::Actions::ActionCachePath.path_for(controller, options) end + # Retrieve instance variables set in the controller. + def assigns(key) + controller.instance_variable_get("@#{key}") + end + private def callback(timing) controller_callback_method_name = "#{timing}_#{controller.controller_name.underscore}" |