Sha256: 98305d838c853dabf39fc2bc35bb1979961723f41c544c74f2581acfa5b8392e

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
    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

26 entries across 26 versions & 1 rubygems

Version Path
effective_orders-6.7.3 app/models/effective/product.rb
effective_orders-6.7.2 app/models/effective/product.rb
effective_orders-6.7.1 app/models/effective/product.rb
effective_orders-6.7.0 app/models/effective/product.rb
effective_orders-6.6.3 app/models/effective/product.rb
effective_orders-6.6.2 app/models/effective/product.rb
effective_orders-6.6.1 app/models/effective/product.rb
effective_orders-6.6.0 app/models/effective/product.rb
effective_orders-6.5.9 app/models/effective/product.rb
effective_orders-6.5.8 app/models/effective/product.rb
effective_orders-6.5.7 app/models/effective/product.rb
effective_orders-6.5.6 app/models/effective/product.rb
effective_orders-6.5.5 app/models/effective/product.rb
effective_orders-6.5.4 app/models/effective/product.rb
effective_orders-6.5.3 app/models/effective/product.rb
effective_orders-6.5.2 app/models/effective/product.rb
effective_orders-6.5.1 app/models/effective/product.rb
effective_orders-6.5.0 app/models/effective/product.rb
effective_orders-6.4.4 app/models/effective/product.rb
effective_orders-6.4.3 app/models/effective/product.rb