Detect mongoid version to use correct method. "default_session" is replaced with "default_client" in mongoid version >= 5.0.0

This commit is contained in:
Thomas Balsløv 2016-04-18 17:08:05 +02:00
parent 49ca0f3e8a
commit 0a2bef7c87

View file

@ -28,7 +28,7 @@ module DatabaseCleaner
private private
def session def session
::Mongoid.default_client ::Mongoid::VERSION > "5.0.0" ? ::Mongoid.default_client : ::Mongoid.default_session
end end
def database def database