Module: ActiveStorage::Attached::Model
- Extended by:
- ActiveSupport::Concern
- Defined in:
- activestorage/lib/active_storage/attached/model.rb
Overview
Active Storage Attached Model
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:.
Methods included from ActiveSupport::Concern
append_features, class_methods, extended, included, prepend_features, prepended
Instance Method Details
#attachment_changes ⇒ Object
:nodoc:
197 198 199 |
# File 'activestorage/lib/active_storage/attached/model.rb', line 197 def # :nodoc: @attachment_changes ||= {} end |
#changed_for_autosave? ⇒ Boolean
:nodoc:
201 202 203 |
# File 'activestorage/lib/active_storage/attached/model.rb', line 201 def changed_for_autosave? # :nodoc: super || .any? end |
#initialize_dup ⇒ Object
:nodoc:
205 206 207 208 209 |
# File 'activestorage/lib/active_storage/attached/model.rb', line 205 def initialize_dup(*) # :nodoc: super @active_storage_attached = nil @attachment_changes = nil end |
#reload ⇒ Object
:nodoc:
211 212 213 |
# File 'activestorage/lib/active_storage/attached/model.rb', line 211 def reload(*) # :nodoc: super.tap { @attachment_changes = nil } end |