1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Document ActiveStorage::Attached::One#blank? [ci skip]

This commit is contained in:
Abhay Nikam 2021-06-03 00:28:25 +05:30
parent b9f48d5d58
commit 0b46d5c184

View file

@ -13,6 +13,13 @@ module ActiveStorage
change.present? ? change.attachment : record.public_send("#{name}_attachment")
end
# Returns +true+ if an attachment is not attached.
#
# class User < ApplicationRecord
# has_one_attached :avatar
# end
#
# User.new.avatar.blank? # => true
def blank?
!attached?
end