Class Order
In: app/models/order.rb
Parent: ActiveRecord::Base

An Order contains details of the purchaser, and has a set of child LineItem rows.

Methods

Constants

PAYMENT_TYPES = { "Check" => "check", "Credit Card" => "cc", "Purchase Order" => "po"   A list of the types of payments we accept. The key is the text displayed in the selection list, and the value is the string that goes into the database.

Public Class methods

Return a count of all orders pending shipping.

[Source]

    # File app/models/order.rb, line 20
20:   def self.count_pending
21:     count("shipped_at is null")
22:   end

Return all orders pending shipping.

[Source]

    # File app/models/order.rb, line 25
25:   def self.pending_shipping
26:     find(:all, :conditions => "shipped_at is null")
27:   end

Public Instance methods

The shipped_at column is NULL for unshipped orders, the dtm of shipment otherwise.

[Source]

    # File app/models/order.rb, line 32
32:   def mark_as_shipped
33:     self.shipped_at = Time.now
34:   end

[Validate]