Sha256: 90272018d97f3e4de2c81c54c0309c88e0fe8aebc0b56ee200d2e2cefb83e1c0

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 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

1 entries across 1 versions & 1 rubygems

Version Path
ems-0.1.0 app/models/ems/asset.rb