Sha256: b4fee2cae7edb755b159b8fa6b331f673d55e80071fe9ecd0e82e34734c17c0e

Contents?: true

Size: 480 Bytes

Versions: 24

Compression:

Stored size: 480 Bytes

Contents

module Effective
  class Product < ActiveRecord::Base
    self.table_name = EffectiveOrders.products_table_name.to_s

    acts_as_purchasable

    # structure do
    #   title         :string
    #   price         :integer, default: 0
    #   tax_exempt    :boolean, default: false
    #
    #   timestamps
    # end

    validates :title, presence: true
    validates :price, numericality: { greater_than: 0 }

    def to_s
      self[:title] || 'New Product'
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
effective_orders-2.2.4 app/models/effective/product.rb
effective_orders-2.2.3 app/models/effective/product.rb
effective_orders-2.2.2 app/models/effective/product.rb
effective_orders-2.2.1 app/models/effective/product.rb
effective_orders-2.2.0 app/models/effective/product.rb
effective_orders-2.1.17 app/models/effective/product.rb
effective_orders-2.1.16 app/models/effective/product.rb
effective_orders-2.1.15 app/models/effective/product.rb
effective_orders-2.1.14 app/models/effective/product.rb
effective_orders-2.1.13 app/models/effective/product.rb
effective_orders-2.1.12 app/models/effective/product.rb
effective_orders-2.1.10 app/models/effective/product.rb
effective_orders-2.1.9 app/models/effective/product.rb
effective_orders-2.1.8 app/models/effective/product.rb
effective_orders-2.1.7 app/models/effective/product.rb
effective_orders-2.1.6 app/models/effective/product.rb
effective_orders-2.1.5 app/models/effective/product.rb
effective_orders-2.1.4 app/models/effective/product.rb
effective_orders-2.1.3 app/models/effective/product.rb
effective_orders-2.1.2 app/models/effective/product.rb