Guest User

Untitled

a guest
Apr 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class ActiveSupport::TestCase
  2. def setup
  3. clear_all_collections
  4. end
  5.  
  6. def clear_all_collections
  7. # ruby 1.9 compatability
  8. Dir[File.join(Rails.root, 'app/models/**/*.rb')].each do |model_path|
  9. klass = File.basename(model_path, '.rb').classify.constantize
  10. klass.collection.remove if klass.respond_to?(:collection)
  11. end
  12. end
  13. end
Add Comment
Please, Sign In to add comment