Sha256: 3e09e7a308a8aa0f7714f35b7af7c18db434bb88f32f5c1df63b826d3f6a1802

Contents?: true

Size: 543 Bytes

Versions: 50

Compression:

Stored size: 543 Bytes

Contents

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

    acts_as_purchasable

    # belongs_to :purchased_order_id

    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

50 entries across 50 versions & 1 rubygems

Version Path
effective_orders-5.5.2 app/models/effective/product.rb
effective_orders-5.5.1 app/models/effective/product.rb
effective_orders-5.5.0 app/models/effective/product.rb
effective_orders-5.4.4 app/models/effective/product.rb
effective_orders-5.4.3 app/models/effective/product.rb
effective_orders-5.4.2 app/models/effective/product.rb
effective_orders-5.4.1 app/models/effective/product.rb
effective_orders-5.4.0 app/models/effective/product.rb
effective_orders-5.3.2 app/models/effective/product.rb
effective_orders-5.3.1 app/models/effective/product.rb
effective_orders-5.3.0 app/models/effective/product.rb
effective_orders-5.2.17 app/models/effective/product.rb
effective_orders-5.2.16 app/models/effective/product.rb
effective_orders-5.2.15 app/models/effective/product.rb
effective_orders-5.2.14 app/models/effective/product.rb
effective_orders-5.2.13 app/models/effective/product.rb
effective_orders-5.2.12 app/models/effective/product.rb
effective_orders-5.2.11 app/models/effective/product.rb
effective_orders-5.2.10 app/models/effective/product.rb
effective_orders-5.2.9 app/models/effective/product.rb