Sha256: 4c3b1dae654222cd39f82e3bd93ccf69a4aaaf2271c7819eed9112996c522c3b
Contents?: true
Size: 513 Bytes
Versions: 14
Compression:
Stored size: 513 Bytes
Contents
class Kuhsaft::Asset < ActiveRecord::Base scope :by_date, -> { order('updated_at DESC') } mount_uploader :file, Kuhsaft::AssetUploader def file_type if file.path.present? && ext = File.extname(file.path).split('.').last ext.to_sym unless ext.blank? end end def name File.basename(file.path) if file.present? && file.path.present? end def path file.url end def path=val # do nothing end def filename try(:file).try(:file).try(:filename) end end
Version data entries
14 entries across 14 versions & 1 rubygems