module ActiveStorage::Attached::Model
def deprecate(action)
def deprecate(action) reflection_name = proxy_association.reflection.name attached_name = reflection_name.to_s.partition("_").first ActiveSupport::Deprecation.warn(<<-MSG.squish) Calling `#{action}` from `#{reflection_name}` is deprecated and will be removed in Rails 7.1. To migrate to Rails 7.1's behavior call `#{action}` from `#{attached_name}` instead: `#{attached_name}.#{action}`. MSG end