Sha256: 928dff2c03d02c7c3acf2c55d5437b3f966a1727b84fb29afdc39258af325fae

Contents?: true

Size: 489 Bytes

Versions: 21

Compression:

Stored size: 489 Bytes

Contents

module Piggybak
  class Shipment < ActiveRecord::Base
    belongs_to :order
    belongs_to :shipping_method

    validates_presence_of :status
    validates_presence_of :total
    validates_presence_of :shipping_method_id

    def status_enum
      ["new", "processing", "shipped"]
    end

    def admin_label
      "Shipment ##{self.id}<br />" +
      "#{self.shipping_method.description}<br />" +
      "Status: #{self.status}<br />" +
      "$#{"%.2f" % self.total}"
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
piggybak-0.1.0 app/models/piggybak/shipment.rb