lib/active_support/callbacks.rb in activesupport-5.1.2 vs lib/active_support/callbacks.rb in activesupport-5.1.3.rc1
- old
+ new
@@ -662,11 +662,13 @@
def set_callback(name, *filter_list, &block)
type, filters, options = normalize_callback_params(filter_list, block)
if options[:if].is_a?(String) || options[:unless].is_a?(String)
ActiveSupport::Deprecation.warn(<<-MSG.squish)
- Passing string to :if and :unless conditional options is deprecated
- and will be removed in Rails 5.2 without replacement.
+ Passing string to be evaluated in :if and :unless conditional
+ options is deprecated and will be removed in Rails 5.2 without
+ replacement. Pass a symbol for an instance method, or a lambda,
+ proc or block, instead.
MSG
end
self_chain = get_callbacks name
mapped = filters.map do |filter|