跳至内容 跳至搜索
方法
M
N
T

常量

DEFAULT_PARTIAL_PATH = "action_text/attachables/missing_attachable"
 

类公共方法

new(sgid)

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

实例公共方法

model()

# File actiontext/lib/action_text/attachables/missing_attachable.rb, line 24
def model
  @sgid&.model_name.to_s.safe_constantize
end

to_partial_path()

# File actiontext/lib/action_text/attachables/missing_attachable.rb, line 16
def to_partial_path
  if model
    model.to_missing_attachable_partial_path
  else
    DEFAULT_PARTIAL_PATH
  end
end