Sha256: 86c65a6d48655ca92b37f200d93c339334a6bce9263724448a4540570ef1aa92
Contents?: true
Size: 702 Bytes
Versions: 13
Compression:
Stored size: 702 Bytes
Contents
class ShopProductAttachmentsDataset < Dataset::Base uses :shop_products def load images = [ :soft_bread_front, :soft_bread_back, :soft_bread_top, :crusty_bread_front, :warm_bread_front ] images.each_with_index do |image, i| create_record :image, image, :title => image.to_s, :asset_file_name => "#{image.to_s}_file_name.png", :asset_content_type => "image/png", :asset_file_size => i+1*1000 create_record :shop_product_attachment, image, :image => images(image.to_sym), :product => shop_products(image.to_s.split('_')[0,2].join('_').to_sym), :position => i + 1 end end end
Version data entries
13 entries across 13 versions & 1 rubygems