Sha256: 559706f69fddc694e5173ffa7407817d3fe8e5427c407004971e58cf705a1946
Contents?: true
Size: 505 Bytes
Versions: 52
Compression:
Stored size: 505 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
52 entries across 52 versions & 1 rubygems