Class: ActiveStorage::Attached

Inherits:
Object
  • Object
show all
Defined in:
activestorage/lib/active_storage/attached.rb

Overview

Active Storage Attached

Abstract base class for the concrete ActiveStorage::Attached::One and ActiveStorage::Attached::Many classes that both provide proxy access to the blob association for a record.

Direct Known Subclasses

Many, One

Defined Under Namespace

Modules: Changes, Model Classes: Many, One

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, record) ⇒ Attached

Returns a new instance of Attached.



13
14
15
# File 'activestorage/lib/active_storage/attached.rb', line 13

def initialize(name, record)
  @name, @record = name, record
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name



11
12
13
# File 'activestorage/lib/active_storage/attached.rb', line 11

def name
  @name
end

#recordObject (readonly)

Returns the value of attribute record



11
12
13
# File 'activestorage/lib/active_storage/attached.rb', line 11

def record
  @record
end