Sha256: 512c25ca010ba30be3288aa1954aede54aaa99b3aa1a2322cd244554edadd920

Contents?: true

Size: 536 Bytes

Versions: 1

Compression:

Stored size: 536 Bytes

Contents

module Ems
  class Asset < ActiveRecord::Base

    attr_accessible :asset

    validates_attachment :asset, :presence => true,
      :content_type => { :content_type => ["image/jpg", "image/jpeg", "image/png"] }

    belongs_to :assetable, :polymorphic => true
    # accepts_nested_attributes_for :assets

    has_attached_file :asset, :styles => {:original => "564"}

    # 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.12 app/models/ems/asset.rb