Class: ActiveShrine::Attached::Changes::CreateMany
- Inherits:
-
Object
- Object
- ActiveShrine::Attached::Changes::CreateMany
- Defined in:
- lib/active_shrine/attached/changes/create_many.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#attachables ⇒ Object
readonly
Returns the value of attribute attachables.
-
#attachment_class ⇒ Object
readonly
Returns the value of attribute attachment_class.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pending_uploads ⇒ Object
readonly
Returns the value of attribute pending_uploads.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #attachments ⇒ Object
-
#initialize(name, record, attachment_class, attachables, pending_uploads: []) ⇒ CreateMany
constructor
A new instance of CreateMany.
- #save ⇒ Object
Constructor Details
#initialize(name, record, attachment_class, attachables, pending_uploads: []) ⇒ CreateMany
Returns a new instance of CreateMany.
9 10 11 12 13 14 15 16 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 9 def initialize(name, record, , attachables, pending_uploads: []) @name = name @record = record = @attachables = Array(attachables) @pending_uploads = Array(pending_uploads) + subchanges end |
Instance Attribute Details
#attachables ⇒ Object (readonly)
Returns the value of attribute attachables.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def attachables @attachables end |
#attachment_class ⇒ Object (readonly)
Returns the value of attribute attachment_class.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def name @name end |
#pending_uploads ⇒ Object (readonly)
Returns the value of attribute pending_uploads.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def pending_uploads @pending_uploads end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
7 8 9 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 7 def record @record end |
Instance Method Details
#attachments ⇒ Object
18 19 20 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 18 def ||= subchanges.collect(&:attachment) end |
#save ⇒ Object
22 23 24 |
# File 'lib/active_shrine/attached/changes/create_many.rb', line 22 def save end |