Created
May 8, 2012 03:45
-
-
Save MikeSilvis/2632390 to your computer and use it in GitHub Desktop.
next_status
This file contains hidden or 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 next_status | |
next_status = { | |
"pending" => :cancel, | |
"shipped" => :return, | |
"paid" => :ship | |
} | |
if next_status["#{self.status.name}"] | |
send(next_status["#{self.status.name}"]) | |
end | |
self.save | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What an amazing gist.