Sha256: c0fe0c38af22c317910f3f2e3d5db401cec5e33f9bfb2edd2a6e3d6c504d31da

Contents?: true

Size: 501 Bytes

Versions: 18

Compression:

Stored size: 501 Bytes

Contents

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

    acts_as_purchasable

    # Attributes
    # title         :string
    # price         :integer, default: 0
    # tax_exempt    :boolean, default: false
    #
    # timestamps

    validates :title, presence: true
    validates :price, presence: true
    validates :tax_exempt, inclusion: { in: [true, false] }

    def to_s
      self[:title] || 'New Product'
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
effective_orders-3.2.3 app/models/effective/product.rb
effective_orders-3.2.2 app/models/effective/product.rb
effective_orders-3.2.1 app/models/effective/product.rb
effective_orders-3.2.0 app/models/effective/product.rb
effective_orders-3.1.7 app/models/effective/product.rb
effective_orders-3.1.6 app/models/effective/product.rb
effective_orders-3.1.4 app/models/effective/product.rb
effective_orders-3.1.3 app/models/effective/product.rb
effective_orders-3.1.0 app/models/effective/product.rb
effective_orders-3.0.4 app/models/effective/product.rb
effective_orders-3.0.3 app/models/effective/product.rb
effective_orders-3.0.2 app/models/effective/product.rb
effective_orders-4.0.0beta4 app/models/effective/product.rb
effective_orders-4.0.0beta3 app/models/effective/product.rb
effective_orders-4.0.0beta2 app/models/effective/product.rb
effective_orders-4.0.0beta1 app/models/effective/product.rb
effective_orders-3.0.1 app/models/effective/product.rb
effective_orders-3.0.0 app/models/effective/product.rb