1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/spec/fake_app/mongoid/config.rb
2012-05-23 13:11:19 +09:00

16 lines
543 B
Ruby

# Ensure we use 'syck' instead of 'psych' in 1.9.2
# RubyGems >= 1.5.0 uses 'psych' on 1.9.2, but
# Psych does not yet support YAML 1.1 merge keys.
# Merge keys is often used in mongoid.yml
# See: http://redmine.ruby-lang.org/issues/show/4300
if RUBY_VERSION >= '1.9.2'
YAML::ENGINE.yamler = 'syck'
end
Mongoid.configure do |config|
if Mongoid::VERSION =~ /^3/
config.sessions = {:default => {:hosts => ['localhost:27017'], :database => 'kaminari_test'}}
else
config.master = Mongo::Connection.new.db('kaminari_test')
end
end