跳至内容 跳至搜索

Active Storage Blob 可识别

方法

实例公有方法

identified?()

# File activestorage/app/models/active_storage/blob/identifiable.rb, line 17
def identified?
  identified
end

identify()

# File activestorage/app/models/active_storage/blob/identifiable.rb, line 5
def identify
  identify_without_saving
  save!
end

identify_without_saving()

# File activestorage/app/models/active_storage/blob/identifiable.rb, line 10
def identify_without_saving
  unless identified?
    self.content_type = identify_content_type
    self.identified = true
  end
end