Created
November 10, 2011 19:27
-
-
Save amiel/1355870 to your computer and use it in GitHub Desktop.
PROTIP
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
# Instead of this | |
after_create :advance_plan | |
def advance_plan | |
plan.advance if plan | |
end |
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
# Or this | |
after_create :advance_plan | |
def advance_plan | |
plan.try :advance | |
end |
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
# Try this, be assertive | |
after_create :advance_plan, :if => :plan | |
def advance_plan | |
plan.advance | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment