Sha256: 602ac3dd83b46304d05b4327e3a542b56de8735a5fe826cba4c93164ee1be06c

Contents?: true

Size: 616 Bytes

Versions: 13

Compression:

Stored size: 616 Bytes

Contents

module MechanizeStore
  class ProductPhoto < ActiveRecord::Base
    belongs_to :product, class_name: MechanizeStore::Product

    has_attached_file :file,
        :styles => { :medium => "300x300>", :thumb => "100x100>" },
        :default_url => "/images/:style/missing.png",
        path: "#{Rails.root}/public/photos/:id/:style.:extension",
        url: "/photos/:id/:style.:extension"
        # storage: :s3,
        # s3_credentials: "#{Rails.root}/config/amazon_s3.yml"

    # validates_attachment_content_type :file, :content_type => /png|jpg|jpeg/
    validates :file, :attachment_presence => true
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mechanize_store-0.0.19 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.18 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.17 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.16 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.15 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.14 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.13 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.12 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.11 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.10 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.8 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.7 app/models/mechanize_store/product_photo.rb
mechanize_store-0.0.6 app/models/mechanize_store/product_photo.rb