Sha256: 1998a3b182bbba607975fecde038011ff87595856e11e3cda87025f930baca2c

Contents?: true

Size: 505 Bytes

Versions: 4

Compression:

Stored size: 505 Bytes

Contents

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

    acts_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

4 entries across 4 versions & 1 rubygems

Version Path
effective_orders-5.0.2 app/models/effective/product.rb
effective_orders-5.0.1 app/models/effective/product.rb
effective_orders-4.6.1 app/models/effective/product.rb
effective_orders-5.0.0 app/models/effective/product.rb