instance method blank?

Ruby on Rails 8.0.4

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

blank?()

Returns true if an attachment is not attached.

class User < ApplicationRecord
  has_one_attached :avatar
end

User.new.avatar.blank? # => true
Source
# File activestorage/lib/active_storage/attached/one.rb, line 44
    def blank?
      !attached?
    end

Defined in activestorage/lib/active_storage/attached/one.rb line 44 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveStorage::Attached::One

Type at least 2 characters to search.

↑↓ navigate · open · esc close