Permalink
Browse files

Fix database object for mongoid version beyond 5

  • Loading branch information...
prabhakar97 committed Jun 27, 2016
1 parent f052d64 commit 3cf0d1b81e4a118fd173d697f032a9aff4f431de
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/database_cleaner/mongoid/truncation.rb
@@ -43,6 +43,18 @@ def database

include ::DatabaseCleaner::Mongo2::TruncationMixin

alias super_database database

private

def database
if ::Mongoid::VERSION > '5'
::Mongoid.default_client.database
else
super_database
end
end

end
end
end

0 comments on commit 3cf0d1b

Please sign in to comment.