Sha256: e1b96425f19442e2532cb88334843ed89e83dc2e50a51455f5601cb8846a0d56
Contents?: true
Size: 483 Bytes
Versions: 11
Compression:
Stored size: 483 Bytes
Contents
module MechanizeStore class Product < ActiveRecord::Base belongs_to :product_category, class_name: MechanizeStore::ProductCategory has_many :product_photos, class_name: MechanizeStore::ProductPhoto validates :name, :price, :description, :short_description, :weight, :length, :width, :height, presence: true def first_photo return nil if self.product_photos.empty? return self.product_photos.first end end end
Version data entries
11 entries across 11 versions & 1 rubygems