Sha256: 77fcf001326283500459ba7f773977c349850211fd8e75a169268c8764420b8e

Contents?: true

Size: 565 Bytes

Versions: 38

Compression:

Stored size: 565 Bytes

Contents

module Effective
  class Product < ActiveRecord::Base
    self.table_name = (EffectiveOrders.products_table_name || :products).to_s

    acts_as_purchasable
    log_changes if respond_to?(:log_changes)

    effective_resource do
      name          :string
      qb_item_name  :string

      price         :integer
      tax_exempt    :boolean

      timestamps
    end

    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

38 entries across 38 versions & 1 rubygems

Version Path
effective_orders-6.17.2 app/models/effective/product.rb
effective_orders-6.17.1 app/models/effective/product.rb
effective_orders-6.17.0 app/models/effective/product.rb
effective_orders-6.16.4 app/models/effective/product.rb
effective_orders-6.16.3 app/models/effective/product.rb
effective_orders-6.16.2 app/models/effective/product.rb
effective_orders-6.16.1 app/models/effective/product.rb
effective_orders-6.16.0 app/models/effective/product.rb
effective_orders-6.15.0 app/models/effective/product.rb
effective_orders-6.14.6 app/models/effective/product.rb
effective_orders-6.14.5 app/models/effective/product.rb
effective_orders-6.14.4 app/models/effective/product.rb
effective_orders-6.14.3 app/models/effective/product.rb
effective_orders-6.14.2 app/models/effective/product.rb
effective_orders-6.14.1 app/models/effective/product.rb
effective_orders-6.14.0 app/models/effective/product.rb
effective_orders-6.13.3 app/models/effective/product.rb
effective_orders-6.13.2 app/models/effective/product.rb
effective_orders-6.13.1 app/models/effective/product.rb
effective_orders-6.13.0 app/models/effective/product.rb