Skip to content

Instantly share code, notes, and snippets.

@banker
Created February 25, 2009 17:17
Show Gist options
  • Save banker/70290 to your computer and use it in GitHub Desktop.
Save banker/70290 to your computer and use it in GitHub Desktop.
class Test::Unit::TestCase
private
def reload_activerecord_instances
self.instance_variables.each do |ivar|
if ivar.is_a?(ActiveRecord::Base) && ivar.respond_to?(:reload)
ivar.reload
end
end
end
end
@wkrsz
Copy link

wkrsz commented Oct 9, 2013

clever!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment