method
_normalize_legacy_filter
v3.1.0 -
Show latest stable
-
0 notes -
Class: ActiveSupport::Callbacks::Callback
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (0)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (0)
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- What's this?
_normalize_legacy_filter(kind, filter)
private
Hide source
# File activesupport/lib/active_support/callbacks.rb, line 310 def _normalize_legacy_filter(kind, filter) if !filter.respond_to?(kind) && filter.respond_to?(:filter) filter.singleton_class.class_eval def #{kind}(context, &block) filter(context, &block) end, __FILE__, __LINE__ + 1 elsif filter.respond_to?(:before) && filter.respond_to?(:after) && kind == :around def filter.around(context) should_continue = before(context) yield if should_continue after(context) end end end