diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb index 4acdfa3d6c72bcd0a1407a227709e20905917368..40611a67e103142ecaf6983ff71fc254b840521e 100644 --- a/activesupport/lib/active_support/core_ext/object/misc.rb +++ b/activesupport/lib/active_support/core_ext/object/misc.rb @@ -1,3 +1,5 @@ +require 'active_support/deprecation' + class Object # Returns +value+ after yielding +value+ to the block. This simplifies the # process of constructing an object, performing work on the object, and then @@ -36,6 +38,7 @@ class Object # # foo # => ['bar', 'baz'] def returning(value) + ActiveSupport::Deprecation.warn('Object#returning has been deprecated in favor of Object#tap.', caller) yield(value) value end