Created
February 24, 2015 12:05
-
-
Save jerry-tao/96d5950f8ab33061ee13 to your computer and use it in GitHub Desktop.
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
class Order < ActiveRecord::Base | |
after_save :close_order, if :finished | |
private | |
def close_order | |
#Some works here | |
end | |
end | |
def finish | |
order.finish | |
order.save | |
end | |
def cancel | |
order.cancel # will set order.finished true | |
order.save | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment