Skip to content

Commit

Permalink
cache_sweeper yields blank output
Browse files Browse the repository at this point in the history
[#3914 state:open]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
Neeraj Singh authored and josevalim committed Jun 8, 2010
1 parent 2500e6a commit db23a95
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions actionpack/lib/action_controller/caching/sweeping.rb
Expand Up @@ -57,6 +57,7 @@ class Sweeper < ActiveRecord::Observer #:nodoc:
def before(controller)
self.controller = controller
callback(:before) if controller.perform_caching
true # before method from sweeper should always return true
end

def after(controller)
Expand Down
3 changes: 3 additions & 0 deletions actionpack/test/abstract_unit.rb
Expand Up @@ -24,6 +24,9 @@
require 'action_dispatch'
require 'active_support/dependencies'
require 'active_model'
require 'active_record'
require 'action_controller/caching'
require 'action_controller/caching/sweeping'

begin
require 'ruby-debug'
Expand Down
6 changes: 6 additions & 0 deletions actionpack/test/controller/filters_test.rb
Expand Up @@ -445,6 +445,12 @@ def filter_three

end


def test_before_method_of_sweeper_should_always_return_true
sweeper = ActionController::Caching::Sweeper.send(:new)
assert sweeper.before(TestController.new)
end

def test_non_yielding_around_filters_not_returning_false_do_not_raise
controller = NonYieldingAroundFilterController.new
controller.instance_variable_set "@filter_return_value", true
Expand Down

0 comments on commit db23a95

Please sign in to comment.