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:
parent
b9f48d5d58
commit
0b46d5c184
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue