Class: ActionText::Attachables::MissingAttachable
- Extended by:
- ActiveModel::Naming
- Defined in:
- actiontext/lib/action_text/attachables/missing_attachable.rb
Constant Summary collapse
- DEFAULT_PARTIAL_PATH =
"action_text/attachables/missing_attachable"
Instance Method Summary collapse
-
#initialize(sgid) ⇒ MissingAttachable
constructor
A new instance of MissingAttachable.
- #model ⇒ Object
- #to_partial_path ⇒ Object
Methods included from ActiveModel::Naming
extended, model_name, param_key, plural, route_key, singular, singular_route_key, uncountable?
Constructor Details
#initialize(sgid) ⇒ MissingAttachable
Returns a new instance of MissingAttachable.
10 11 12 |
# 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 ⇒ Object
22 23 24 |
# File 'actiontext/lib/action_text/attachables/missing_attachable.rb', line 22 def model @sgid&.model_name.to_s.safe_constantize end |
#to_partial_path ⇒ Object
14 15 16 17 18 19 20 |
# 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 |