Created
February 2, 2010 21:37
-
-
Save burke/293060 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
| class MyModel < ActiveRecord::Base | |
| def self.find_by_name(*args) | |
| super(*args) || raise(ActiveRecord::RecordNotFound) | |
| # What happens here is that occasionally (always, with rspec), super(*args) causes | |
| # the method to return nil immediately, and not evaluate anything else in the method body. | |
| # We've even tried: | |
| # super(*args) | |
| # raise StandardError | |
| # and rspec still just gets nil. | |
| # Halp? | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment