Skip to content

Instantly share code, notes, and snippets.

@ryanhanks
Created April 21, 2011 03:06
Show Gist options
  • Save ryanhanks/933623 to your computer and use it in GitHub Desktop.
Save ryanhanks/933623 to your computer and use it in GitHub Desktop.
def status
return "pending" if effective_date > Date.today
if cancellation_date
cancellation_date <= Date.today ? "cancelled" : "pending_cancellation"
else
if expiration_date <= Date.today
renew ? "renewed" : "expired"
else
"in_force"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment