From 6777f7b75d1d10ff148e3d72cef3ef642de5bda3 Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Fri, 7 Sep 2012 14:42:31 +0300 Subject: AS::Callbacks: deprecate monkey patch of object callbacks --- activesupport/lib/active_support/callbacks.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index a55f68497c..7166c21268 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -279,6 +279,7 @@ module ActiveSupport def _normalize_legacy_filter(kind, filter) if !filter.respond_to?(kind) && filter.respond_to?(:filter) + ActiveSupport::Deprecation.warn("Filter object with #filter method is deprecated. Define method corresponding to filter type (#before, #after or #around).") filter.singleton_class.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def #{kind}(context, &block) filter(context, &block) end RUBY_EVAL -- cgit v1.2.3