Sha256: 28f4752276771fbabb032bb66edc42205cea667a2b63cbf67f14090f23ab5885

Contents?: true

Size: 492 Bytes

Versions: 66

Compression:

Stored size: 492 Bytes

Contents

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

    acts_as_purchasable

    # Attributes
    # name          :string
    # price         :integer, default: 0
    # tax_exempt    :boolean, default: false
    #
    # timestamps

    validates :name, presence: true
    validates :price, presence: true
    validates :tax_exempt, inclusion: { in: [true, false] }

    def to_s
      name || 'New Product'
    end

  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
effective_orders-4.4.6 app/models/effective/product.rb
effective_orders-4.4.5 app/models/effective/product.rb
effective_orders-4.4.4 app/models/effective/product.rb
effective_orders-4.4.3 app/models/effective/product.rb
effective_orders-4.4.2 app/models/effective/product.rb
effective_orders-4.4.1 app/models/effective/product.rb
effective_orders-4.4.0 app/models/effective/product.rb
effective_orders-4.3.2 app/models/effective/product.rb
effective_orders-4.3.1 app/models/effective/product.rb
effective_orders-4.3.0 app/models/effective/product.rb
effective_orders-4.2.7 app/models/effective/product.rb
effective_orders-4.2.6 app/models/effective/product.rb
effective_orders-4.2.5 app/models/effective/product.rb
effective_orders-4.2.4 app/models/effective/product.rb
effective_orders-4.2.3 app/models/effective/product.rb
effective_orders-4.2.2 app/models/effective/product.rb
effective_orders-4.2.1 app/models/effective/product.rb
effective_orders-4.2.0 app/models/effective/product.rb
effective_orders-4.1.5 app/models/effective/product.rb
effective_orders-4.1.4 app/models/effective/product.rb