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.4.12 app/models/piggybak/shipment.rb
piggybak-0.4.11 app/models/piggybak/shipment.rb
piggybak-0.4.10 app/models/piggybak/shipment.rb
piggybak-0.4.9 app/models/piggybak/shipment.rb
piggybak-0.4.8 app/models/piggybak/shipment.rb
piggybak-0.4.7.1 app/models/piggybak/shipment.rb
piggybak-0.4.7 app/models/piggybak/shipment.rb
piggybak-0.4.6 app/models/piggybak/shipment.rb
piggybak-0.4.5 app/models/piggybak/shipment.rb
piggybak-0.4.4 app/models/piggybak/shipment.rb
piggybak-0.4.3 app/models/piggybak/shipment.rb
piggybak-0.4.2 app/models/piggybak/shipment.rb
piggybak-0.4.1 app/models/piggybak/shipment.rb
piggybak-0.4.0 app/models/piggybak/shipment.rb
piggybak-0.3.2 app/models/piggybak/shipment.rb
piggybak-0.3.1 app/models/piggybak/shipment.rb
piggybak-0.3.0 app/models/piggybak/shipment.rb
piggybak-0.2.1 app/models/piggybak/shipment.rb
piggybak-0.2.0 app/models/piggybak/shipment.rb
piggybak-0.1.1 app/models/piggybak/shipment.rb