Skip to content

Instantly share code, notes, and snippets.

@hoffm
Created August 14, 2013 13:28
Show Gist options
  • Save hoffm/6231009 to your computer and use it in GitHub Desktop.
Save hoffm/6231009 to your computer and use it in GitHub Desktop.
Definition of #status for VendorOrderFulfillment.
def status
if self.reverted then
"Reverted"
elsif !self.ship_date then
"Open"
elsif (self.tracking_numbers.length == 0 and !self.shipping_cost_micros) then
"Processing (awaiting)"
else
self.ship_date > Date.today ?
"Processing" :
"Shipped"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment