Sha256: 37fb8508fa469b1b202662d28d8b68caaf1d09e22739c2a5fd4e2534b6913c1f

Contents?: true

Size: 550 Bytes

Versions: 26

Compression:

Stored size: 550 Bytes

Contents

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

    acts_as_purchasable

    has_many :order_items, as: :purchasable

    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

26 entries across 26 versions & 1 rubygems

Version Path
effective_orders-6.2.1 app/models/effective/product.rb
effective_orders-6.2.0 app/models/effective/product.rb
effective_orders-6.1.5 app/models/effective/product.rb
effective_orders-6.1.4 app/models/effective/product.rb
effective_orders-6.1.3 app/models/effective/product.rb
effective_orders-6.1.2 app/models/effective/product.rb
effective_orders-6.1.1 app/models/effective/product.rb
effective_orders-6.1.0 app/models/effective/product.rb
effective_orders-6.0.1 app/models/effective/product.rb
effective_orders-6.0.0 app/models/effective/product.rb
effective_orders-5.9.4 app/models/effective/product.rb
effective_orders-5.9.3 app/models/effective/product.rb
effective_orders-5.9.2 app/models/effective/product.rb
effective_orders-5.9.1 app/models/effective/product.rb
effective_orders-5.9.0 app/models/effective/product.rb
effective_orders-5.8.2 app/models/effective/product.rb
effective_orders-5.8.1 app/models/effective/product.rb
effective_orders-5.8.0 app/models/effective/product.rb
effective_orders-5.7.4 app/models/effective/product.rb
effective_orders-5.7.3 app/models/effective/product.rb