Class: ClowneActiveStorage::Declarations::IncludeAttached
- Inherits:
-
Clowne::Declarations::Base
- Object
- Clowne::Declarations::Base
- ClowneActiveStorage::Declarations::IncludeAttached
- Defined in:
- lib/clowne_active_storage/declarations/include_attached.rb
Overview
DSL to add associations to ActiveStorage Attachments and Blobs for single attachments
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #compile(plan) ⇒ Object
-
#initialize(name) ⇒ IncludeAttached
constructor
A new instance of IncludeAttached.
Constructor Details
#initialize(name) ⇒ IncludeAttached
Returns a new instance of IncludeAttached.
10 11 12 |
# File 'lib/clowne_active_storage/declarations/include_attached.rb', line 10 def initialize(name) @name = name.to_sym end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/clowne_active_storage/declarations/include_attached.rb', line 8 def name @name end |
Instance Method Details
#compile(plan) ⇒ Object
14 15 16 |
# File 'lib/clowne_active_storage/declarations/include_attached.rb', line 14 def compile(plan) plan.set :attachment_association, self end |