instance method
attached?
Ruby on Rails 5.2.8.1
Since v5.2.8.1Signature
attached?()
Returns true if any attachments has been made.
class Gallery < ActiveRecord::Base has_many_attached :photos end Gallery.new.photos.attached? # => false
Source
# File activestorage/lib/active_storage/attached/many.rb, line 38
def attached?
attachments.any?
end
Defined in activestorage/lib/active_storage/attached/many.rb line 38
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Attached::Many