Sha256: 2339df2518b2810fad6d75f982109fe05d280b32b9bfb2c7e7518dbcf41b62cb

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

class Asset < ActiveRecord::Base
  has_friendly_id :title, :use_slug => true, :cache_column => :permalink
  acts_as_taggable_on :tags, :categories
  acts_as_joinable
  
  has_attached_file :data,
    :styles => {
      :medium => "300x300>",
      :thumb => "120x120#",
      :tiny => "50x50#",
      :micro => "20x20#"
    },
    :storage => :s3,
    :s3_credentials => {
      :access_key_id => Settings("s3.key"),
      :secret_access_key => Settings("s3.secret")
    },
    :path => Settings("s3.permalink"),
    :bucket => Settings("s3.bucket")
    
  def url(style = nil)
    data.url(style || data.default_style)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-assetable-0.0.1.5 lib/asset.rb