Sha256: 3d5e6010d3bcebd55c162215b49dca22f05c66ef29a5ef9f13c28bbfc1e09e39
Contents?: true
Size: 478 Bytes
Versions: 9
Compression:
Stored size: 478 Bytes
Contents
module Ems class Asset < ActiveRecord::Base validates_attachment :asset, :presence => true, :content_type => { :content_type => ["image/jpg", "image/jpeg"] } belongs_to :assetable, :polymorphic => true has_attached_file :asset, :styles => {:original => "564x252>"} # virtual alt text accessor - returns the title of the image otherwise the path def alt alt = self.title alt ||= self.image.url end end end
Version data entries
9 entries across 9 versions & 1 rubygems