Skip to Content Skip to Search

class ActionText::Attachables::MissingAttachable

Constants

DEFAULT_PARTIAL_PATH

"action_text/attachables/missing_attachable"

Public class methods

new(sgid)

Permalink
Source code GitHub
# File actiontext/lib/action_text/attachables/missing_attachable.rb, line 10
def initialize(sgid)
  @sgid = SignedGlobalID.parse(sgid, for: ActionText::Attachable::LOCATOR_NAME)
end

Public instance methods

model()

Permalink
Source code 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()

Permalink
Source code 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

Definition files