Sha256: 6fb3ec0c909eba653eaeb7d69dd82376639dcb330672c24bd21e47afc144b8aa

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

class ShopProductAttachment < ActiveRecord::Base
  
  default_scope :order => 'shop_product_attachments.position ASC'
  
  belongs_to    :product,   :class_name => 'ShopProduct', :foreign_key => :shop_product_id
  belongs_to    :image
  
  acts_as_list  :scope =>   :shop_product
  
  def url(*params)
    image.url(*params) rescue nil
  end
  
  def title(*params)
    image.title(*params) rescue nil
  end
  
  def caption(*params)
    image.caption(*params) rescue nil
  end
  
  class << self
    
    def params
      [ :id, :title, :caption, :image_file_name, :image_content_type, :image_file_size ]
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-shop-extension-0.10.0 app/models/shop_product_attachment.rb
radiant-shop-extension-0.9.3 app/models/shop_product_attachment.rb
radiant-shop-extension-0.9.2 app/models/shop_product_attachment.rb