123456789_123456789_123456789_123456789_123456789_

Class: ActiveStorage::Attached

Relationships & Source Files
Namespace Children
Modules:
Classes:
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: activestorage/lib/active_storage/attached.rb

Overview

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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(name, record) ⇒ Attached

[ GitHub ]

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

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

Instance Attribute Details

#name (readonly)

[ GitHub ]

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

attr_reader :name, :record

#record (readonly)

[ GitHub ]

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

attr_reader :name, :record

Instance Method Details

#change (private)

[ GitHub ]

  
# File 'activestorage/lib/active_storage/attached.rb', line 18

def change
  record.attachment_changes[name]
end