Sha256: 149ffaa531f99236846eba0c790648802a3c74ab1243934ed6668310ee875bee
Contents?: true
Size: 557 Bytes
Versions: 16
Compression:
Stored size: 557 Bytes
Contents
module Qbrick class Asset < ActiveRecord::Base scope :by_date, -> { order('updated_at DESC') } mount_uploader :file, Qbrick::AssetUploader def file_type return unless file.path.present? ext = File.extname(file.path).split('.').last ext.to_sym if ext.present? 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 end
Version data entries
16 entries across 16 versions & 1 rubygems