Class: ActiveStorage::AwsRecord::Attachment::NullBlobRelation

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/active_storage/aws_record/attachment.rb

Overview

Empty relation backing Blob#attachments.

Instance Method Summary collapse

Constructor Details

#initialize(persisted) ⇒ NullBlobRelation

Returns a new instance of NullBlobRelation.



384
385
386
# File 'lib/active_storage/aws_record/attachment.rb', line 384

def initialize(persisted)
  @persisted = persisted
end

Instance Method Details

#any?Boolean

Returns:

  • (Boolean)


404
405
406
407
# File 'lib/active_storage/aws_record/attachment.rb', line 404

def any?
  guard!
  false
end

#each(&block) ⇒ Object



388
389
390
391
# File 'lib/active_storage/aws_record/attachment.rb', line 388

def each(&block)
  guard!
  [].each(&block)
end

#empty?Boolean

Returns:

  • (Boolean)


409
410
411
412
# File 'lib/active_storage/aws_record/attachment.rb', line 409

def empty?
  guard!
  true
end

#findObject



393
394
395
396
# File 'lib/active_storage/aws_record/attachment.rb', line 393

def find(*)
  guard!
  nil
end

#to_aObject Also known as: to_ary



398
399
400
401
# File 'lib/active_storage/aws_record/attachment.rb', line 398

def to_a
  guard!
  []
end