aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/deprecated/dispatcher.rb
blob: 3da3c8ce7dd236073ae2453e887b64cec978b8da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module ActionController
  class Dispatcher
    cattr_accessor :prepare_each_request
    self.prepare_each_request = false

    class << self
      def before_dispatch(*args, &block)
        ActiveSupport::Deprecation.warn "ActionController::Dispatcher.before_dispatch is deprecated. " <<
          "Please use ActionDispatch::Callbacks.before instead.", caller
        ActionDispatch::Callbacks.before(*args, &block)
      end

      def after_dispatch(*args, &block)
        ActiveSupport::Deprecation.warn "ActionController::Dispatcher.after_dispatch is deprecated. " <<
          "Please use ActionDispatch::Callbacks.after instead.", caller
        ActionDispatch::Callbacks.after(*args, &block)
      end

      def to_prepare(*args, &block)
        ActiveSupport::Deprecation.warn "ActionController::Dispatcher.to_prepare is deprecated. " <<
          "Please use ActionDispatch::Callbacks.to_prepare instead.", caller
        ActionDispatch::Callbacks.after(*args, &block)
      end

      def new
        ActiveSupport::Deprecation.warn "ActionController::Dispatcher.new is deprecated, use Rails.application instead."
        Rails.application
      end
    end
  end
end