Created
August 14, 2013 13:28
-
-
Save hoffm/6231009 to your computer and use it in GitHub Desktop.
Definition of #status for VendorOrderFulfillment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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