1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Use Mongoid::Config#connect_to to congigure connection on Mongoid 5.0

This commit is contained in:
Yuki Nishijima 2016-01-02 07:34:23 +00:00
parent 3b4ce1e72d
commit 505b88f535

View file

@ -10,7 +10,9 @@ if RUBY_VERSION >= '1.9.2' && RUBY_VERSION < '2.2.0'
end
Mongoid.configure do |config|
if Mongoid::VERSION > '3.0.0'
if Mongoid::VERSION >= '5.0.0'
config.connect_to 'kaminari_test'
elsif Mongoid::VERSION > '3.0.0'
config.sessions = {:default => {:hosts => ['0.0.0.0:27017'], :database => 'kaminari_test'}}
else
config.master = Mongo::Connection.new.db('kaminari_test')