Class: ActionText::Attachables::MissingAttachable
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::ActiveModel::Naming
|
|
Inherits: | Object |
Defined in: | actiontext/lib/action_text/attachables/missing_attachable.rb |
Constant Summary
-
DEFAULT_PARTIAL_PATH =
# File 'actiontext/lib/action_text/attachables/missing_attachable.rb', line 8"action_text/attachables/missing_attachable"
Class Method Summary
- .new(sgid) ⇒ MissingAttachable constructor
::ActiveModel::Naming
- Extended
model_name | Returns an |
Instance Method Summary
Constructor Details
.new(sgid) ⇒ MissingAttachable
# File 'actiontext/lib/action_text/attachables/missing_attachable.rb', line 10
def initialize(sgid) @sgid = SignedGlobalID.parse(sgid, for: ActionText::Attachable::LOCATOR_NAME) end
Instance Method Details
#model
[ GitHub ]# File 'actiontext/lib/action_text/attachables/missing_attachable.rb', line 22
def model @sgid&.model_name.to_s.safe_constantize end
#to_partial_path
[ GitHub ]# File 'actiontext/lib/action_text/attachables/missing_attachable.rb', line 14
def to_partial_path if model model.to_missing_attachable_partial_path else DEFAULT_PARTIAL_PATH end end