debuggerなどで
puts _process_action_callbacks
Controllerの継承とかextend ActiveSupport::Concernとかやってて、
skip_before_filter使ったときに良くわからない事になったので調べたらあった。
例えば次のようなデバッグプリントを追加してfilterを調査する。
hoge_controller.rb
class HogeController < MyBaseController
puts _process_action_callbacks.map(&:raw_filter).inspect
skip_before_filter :set_hage
puts _process_action_callbacks.map(&:raw_filter).inspect
...
#=> [:verify_authenticity_token, :set_hage]
#=> [:verify_authenticity_token]
callbackの内容
(rdb:1) pp _process_action_callbacks.first
#<ActiveSupport::Callbacks::Callback:0x007f99d99c6060
@callback_id=14,
@chain=
[#<ActiveSupport::Callbacks::Callback:0x007f99d99c6060 ...>,
#<ActiveSupport::Callbacks::Callback:0x007f99ded359d0
@callback_id=8,
@chain=[#<ActiveSupport::Callbacks::Callback:0x007f99ded359d0 ...>],
@compiled_options="true",
@filter=:set_hage,
@kind=:before,
@klass=ActionController::Base,
@options={:if=>[], :unless=>[]},
@per_key={:if=>[], :unless=>[]},
@raw_filter=:set_hage>],
@compiled_options="true",
@filter=:verify_authenticity_token,
@kind=:before,
@klass=ApplicationController,
@options={:prepend=>true, :if=>[], :unless=>[]},
@per_key={:if=>[], :unless=>[]},
@raw_filter=:verify_authenticity_token>
Modelの場合は調べてない