Skip to content

Commit ccecab3

Browse files
committed
Remove observers and sweepers
They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
1 parent e38d310 commit ccecab3

File tree

39 files changed

+14
-1961
lines changed

39 files changed

+14
-1961
lines changed

actionpack/lib/action_controller/caching.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ module ActionController
66
# \Caching is a cheap way of speeding up slow applications by keeping the result of
77
# calculations, renderings, and database calls around for subsequent requests.
88
#
9-
# You can read more about each approach and the sweeping assistance by clicking the
9+
# You can read more about each approach and the by clicking the
1010
# modules below.
1111
#
12-
# Note: To turn off all caching and sweeping, set
12+
# Note: To turn off all caching, set
1313
# config.action_controller.perform_caching = false.
1414
#
1515
# == \Caching stores
@@ -30,8 +30,6 @@ module Caching
3030

3131
eager_autoload do
3232
autoload :Fragments
33-
autoload :Sweeper, 'action_controller/caching/sweeping'
34-
autoload :Sweeping, 'action_controller/caching/sweeping'
3533
end
3634

3735
module ConfigMethods
@@ -54,7 +52,6 @@ def cache_configured?
5452

5553
include ConfigMethods
5654
include Fragments
57-
include Sweeping if defined?(ActiveRecord)
5855

5956
included do
6057
extend ConfigMethods

actionpack/lib/action_controller/caching/sweeping.rb

Lines changed: 0 additions & 116 deletions
This file was deleted.

actionpack/test/abstract_unit.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
require 'active_model'
2626
require 'active_record'
2727
require 'action_controller/caching'
28-
require 'action_controller/caching/sweeping'
2928

3029
require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
3130

actionpack/test/controller/filters_test.rb

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,6 @@ def filter_three
499499

500500
end
501501

502-
class ::AppSweeper < ActionController::Caching::Sweeper; end
503-
class SweeperTestController < ActionController::Base
504-
cache_sweeper :app_sweeper
505-
def show
506-
render :text => 'hello world'
507-
end
508-
509-
def error
510-
raise StandardError.new
511-
end
512-
end
513-
514502
class ImplicitActionsController < ActionController::Base
515503
before_filter :find_only, :only => :edit
516504
before_filter :find_except, :except => :edit
@@ -526,35 +514,6 @@ def find_except
526514
end
527515
end
528516

529-
def test_sweeper_should_not_ignore_no_method_error
530-
sweeper = ActionController::Caching::Sweeper.send(:new)
531-
assert_raise NoMethodError do
532-
sweeper.send_not_defined
533-
end
534-
end
535-
536-
def test_sweeper_should_not_block_rendering
537-
response = test_process(SweeperTestController)
538-
assert_equal 'hello world', response.body
539-
end
540-
541-
def test_sweeper_should_clean_up_if_exception_is_raised
542-
assert_raise StandardError do
543-
test_process(SweeperTestController, 'error')
544-
end
545-
assert_nil AppSweeper.instance.controller
546-
end
547-
548-
def test_before_method_of_sweeper_should_always_return_true
549-
sweeper = ActionController::Caching::Sweeper.send(:new)
550-
assert sweeper.before(TestController.new)
551-
end
552-
553-
def test_after_method_of_sweeper_should_always_return_nil
554-
sweeper = ActionController::Caching::Sweeper.send(:new)
555-
assert_nil sweeper.after(TestController.new)
556-
end
557-
558517
def test_non_yielding_around_filters_not_returning_false_do_not_raise
559518
controller = NonYieldingAroundFilterController.new
560519
controller.instance_variable_set "@filter_return_value", true

actionpack/test/controller/sweeper_test.rb

Lines changed: 0 additions & 16 deletions
This file was deleted.

activemodel/lib/active_model.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ module ActiveModel
4040
autoload :DeprecatedMassAssignmentSecurity
4141
autoload :Name, 'active_model/naming'
4242
autoload :Naming
43-
autoload :Observer, 'active_model/observing'
44-
autoload :Observing
4543
autoload :SecurePassword
4644
autoload :Serialization
4745
autoload :TestCase

activemodel/lib/active_model/observer_array.rb

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)