Sha256: a12f202c3a218282ac6f1de9e03e56c982345bb1cba7f8a3bcffc4678e763b43

Contents?: true

Size: 695 Bytes

Versions: 7

Compression:

Stored size: 695 Bytes

Contents

class ShopProductAttachment < ActiveRecord::Base
  
  default_scope :order => 'shop_product_attachments.position ASC'
  
  belongs_to    :product,   :class_name => 'ShopProduct'
  belongs_to    :image
  
  belongs_to  :created_by,  :class_name => 'User'
  belongs_to  :updated_by,  :class_name => 'User'
  
  acts_as_list  :scope =>   :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

7 entries across 7 versions & 1 rubygems

Version Path
radiant-shop-extension-0.90.0 app/models/shop_product_attachment.rb
radiant-shop-extension-0.11.6 app/models/shop_product_attachment.rb
radiant-shop-extension-0.11.5 app/models/shop_product_attachment.rb
radiant-shop-extension-0.11.4 app/models/shop_product_attachment.rb
radiant-shop-extension-0.11.3 app/models/shop_product_attachment.rb
radiant-shop-extension-0.11.1 app/models/shop_product_attachment.rb
radiant-shop-extension-0.11.0 app/models/shop_product_attachment.rb