Sha256: 3d049d616494824e1b32df51eb8b07b01a12f81d3c4d739619a529a5c2c52ccb
Contents?: true
Size: 829 Bytes
Versions: 4
Compression:
Stored size: 829 Bytes
Contents
module CabooseStore class ProductImage < ActiveRecord::Base self.table_name = "store_product_images" belongs_to :product has_and_belongs_to_many :variants attr_accessible :id, :title has_attached_file :image, #:path => "#{Rails.root}/public/products/:product_id_:id_:style.:extension", :path => "products/:product_id_:id_:style.:extension", :default_url => '/products/:id_:style.:extension', :styles => { :tiny => '100x100>', :thumb => '250x250>', :medium => '400x400>', :large => '800x800>', :huge => '1200x1200>' } def url(size) # 'tiny', 'thumb', 'medium', 'large', 'huge' self.image.url(size) #"https://s3.amazonaws.com/tuskwear/products/#{self.product_id}_#{self.id}_#{size}.jpg" end end end
Version data entries
4 entries across 4 versions & 1 rubygems