Module: ActiveStorage::Attached::Model
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_storage/attached/model.rb
Overview
Provides the class-level DSL for declaring an Active Record model's attachments.
Instance Method Summary collapse
-
#attachment_changes ⇒ Object
:nodoc:.
-
#changed_for_autosave? ⇒ Boolean
:nodoc:.
-
#initialize_dup ⇒ Object
:nodoc:.
-
#reload ⇒ Object
:nodoc:.
Instance Method Details
#attachment_changes ⇒ Object
:nodoc:
141 142 143 |
# File 'lib/active_storage/attached/model.rb', line 141 def #:nodoc: @attachment_changes ||= {} end |
#changed_for_autosave? ⇒ Boolean
:nodoc:
145 146 147 |
# File 'lib/active_storage/attached/model.rb', line 145 def changed_for_autosave? #:nodoc: super || .any? end |
#initialize_dup ⇒ Object
:nodoc:
149 150 151 152 153 |
# File 'lib/active_storage/attached/model.rb', line 149 def initialize_dup(*) #:nodoc: super @active_storage_attached = nil @attachment_changes = nil end |
#reload ⇒ Object
:nodoc:
155 156 157 |
# File 'lib/active_storage/attached/model.rb', line 155 def reload(*) #:nodoc: super.tap { @attachment_changes = nil } end |