Created
February 6, 2010 17:53
-
-
Save chrisun/296854 to your computer and use it in GitHub Desktop.
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
| before_save :do_something | |
| def do_something | |
| self.attr_c = self.attr_a < self.attr_b | |
| 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
| # this works, note that we add logging to the last line. | |
| def do_something | |
| self.attr_c = self.attr_a < self.attr_b | |
| logger.debug 'some message' | |
| 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
| def do_something | |
| self.attr_c = self.attr_a < self.attr_b | |
| true | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment