Sha256: 9113eb17ca0ea8bc23f17694f40a3a5f1d275e10a985ef3cca499cb4ce15257a
Contents?: true
Size: 392 Bytes
Versions: 20
Compression:
Stored size: 392 Bytes
Contents
class Kindeditor::Asset < ActiveRecord::Base self.table_name = 'kindeditor_assets' mount_uploader :asset, Kindeditor::AssetUploader validates_presence_of :asset before_save :update_asset_attributes private def update_asset_attributes if asset.present? && asset_changed? self.file_size = asset.file.size self.file_type = asset.file.content_type end end end
Version data entries
20 entries across 20 versions & 6 rubygems