File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ module ControllerLifecycle
5
5
6
6
included do
7
7
# use both names to support Rails 3..5
8
- before_action_with_fallback = begin method ( :before_action ) ; rescue method ( :before_filter ) ; end
9
- after_action_with_fallback = begin method ( :after_action ) ; rescue method ( :after_filter ) ; end
10
- before_action_with_fallback . call :setup_react_component_helper
11
- after_action_with_fallback . call :teardown_react_component_helper
8
+ before_action_with_fallback = respond_to? ( :before_action ) ? :before_action : :before_filter
9
+ after_action_with_fallback = respond_to? ( :after_action ) ? :after_action : :after_filter
10
+ public_send ( before_action_with_fallback , :setup_react_component_helper )
11
+ public_send ( after_action_with_fallback , :teardown_react_component_helper )
12
12
attr_reader :__react_component_helper
13
13
end
14
14
You can’t perform that action at this time.
0 commit comments