Sha256: e7acd0f70d397e2e94103d5b10a8b3002a919a958336cb9fffd7d0a04acc16a5

Contents?: true

Size: 519 Bytes

Versions: 2

Compression:

Stored size: 519 Bytes

Contents

class Asset < ActiveRecord::Base
  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

2 entries across 2 versions & 1 rubygems

Version Path
acts-as-assetable-0.0.2.1 app/models/asset.rb
acts-as-assetable-0.0.2.0 app/models/asset.rb