instance method
attached?
Ruby on Rails 5.2.8.1
Since v5.2.8.1Signature
attached?()
Returns true if an attachment has been made.
class User < ActiveRecord::Base has_one_attached :avatar end User.new.avatar.attached? # => false
Source
# File activestorage/lib/active_storage/attached/one.rb, line 43
def attached?
attachment.present?
end
Defined in activestorage/lib/active_storage/attached/one.rb line 43
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Attached::One