Sha256: 37ed6e533f0cd1e90451c92360cb10fe5f3eb835e1fd63b55fb4e17f7828ea4b

Contents?: true

Size: 665 Bytes

Versions: 12

Compression:

Stored size: 665 Bytes

Contents

require "carrierwave"
require "carrierwave/orm/activerecord"

module Adminpanel
  class Product < ActiveRecord::Base
    attr_accessible :description, :name, :images_attributes, :category_id, :brief
    has_many :images, :foreign_key => "foreign_key", :conditions => { :model => "Product" }
    belongs_to :category
    accepts_nested_attributes_for :images, :allow_destroy => true

    validates_presence_of :name
    validates_presence_of :description
    validates_presence_of :category_id
    validates_presence_of :brief

    def to_param
    	"#{id} #{name}".parameterize
    end

    def simple_name
        "Product"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
adminpanel-0.1.1 app/models/adminpanel/product.rb
adminpanel-0.1.0cl.2 app/models/adminpanel/product.rb
adminpanel-0.1.0cl app/models/adminpanel/product.rb
adminpanel-0.1.0 app/models/adminpanel/product.rb
adminpanel-0.0.7 app/models/adminpanel/product.rb
adminpanel-0.0.6.1 app/models/adminpanel/product.rb
adminpanel-0.0.6 app/models/adminpanel/product.rb
adminpanel-0.0.5 app/models/adminpanel/product.rb
adminpanel-0.0.4 app/models/adminpanel/product.rb
adminpanel-0.0.3 app/models/adminpanel/product.rb
adminpanel-0.0.2 app/models/adminpanel/product.rb
adminpanel-0.0.1 app/models/adminpanel/product.rb