Skip to content

Instantly share code, notes, and snippets.

@skwp
Created July 30, 2008 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skwp/3277 to your computer and use it in GitHub Desktop.
Save skwp/3277 to your computer and use it in GitHub Desktop.
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