mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
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:
parent
49ca0f3e8a
commit
0a2bef7c87
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ module DatabaseCleaner
|
|||
private
|
||||
|
||||
def session
|
||||
::Mongoid.default_client
|
||||
::Mongoid::VERSION > "5.0.0" ? ::Mongoid.default_client : ::Mongoid.default_session
|
||||
end
|
||||
|
||||
def database
|
||||
|
|
Loading…
Reference in a new issue