instance method
attached?
Ruby on Rails 6.0.6
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 45
def attached?
attachments.any?
end
Defined in activestorage/lib/active_storage/attached/many.rb line 45
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Attached::Many