Skip to content
Browse files

Merge pull request #4446 from ayamomiji/patch-1

prevent the cache sweeper ignores NoMethodError
  • Loading branch information...
2 parents acae4fd + 2ac6735 commit 91cb99e9e4ef1b543cf60c2e56cf3ea865a2ac76 @josevalim josevalim committed
View
2 actionpack/lib/action_controller/caching/sweeping.rb
@@ -93,7 +93,7 @@ def callback(timing)
end
def method_missing(method, *arguments, &block)
- super unless @controller
+ return super unless @controller
@controller.__send__(method, *arguments, &block)
end
end
View
7 actionpack/test/controller/filters_test.rb
@@ -510,6 +510,13 @@ def find_except
end
end
+ def test_sweeper_should_not_ignore_no_method_error
+ sweeper = ActionController::Caching::Sweeper.send(:new)
+ assert_raise NoMethodError do
+ sweeper.send_not_defined
+ end
+ end
+
def test_sweeper_should_not_block_rendering
response = test_process(SweeperTestController)
assert_equal 'hello world', response.body

0 comments on commit 91cb99e

Please sign in to comment.
Something went wrong with that request. Please try again.