Created
July 30, 2008 15:44
-
-
Save skwp/3277 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
Fixture.class_eval do | |
def find | |
if model_class | |
if model_class.respond_to?(:find_with_deleted) | |
model_class.find_with_deleted(self[model_class.primary_key]) | |
else | |
model_class.find(self[model_class.primary_key]) | |
end | |
else | |
raise FixtureClassNotFound, "No class attached to find." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment