Sha256: d07eb6296b9d304dd43e7cbb5310f9d8e2699a40b76d33d736e8c7842df94402
Contents?: true
Size: 499 Bytes
Versions: 13
Compression:
Stored size: 499 Bytes
Contents
require 'carrierwave/mongoid' class Kindeditor::Asset include Mongoid::Document include Mongoid::Timestamps mount_uploader :asset, Kindeditor::AssetUploader field :file_size, :type => Integer field :file_type, :type => String validates_presence_of :asset before_save :update_asset_attributes def self.collection_name :kindeditor_assets end private def update_asset_attributes self.file_size = asset.file.size self.file_type = asset.file.content_type end end
Version data entries
13 entries across 13 versions & 2 rubygems