Skip to content

Commit

Permalink
Added support for Mongoid5.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Oct 5, 2015
1 parent 90a1cd0 commit c806c64
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ gemfile:
- gemfiles/mongoid_30.gemfile
- gemfiles/mongoid_31.gemfile
- gemfiles/mongoid_40.gemfile
- gemfiles/mongoid_50.gemfile
- gemfiles/sinatra_14.gemfile

sudo: false
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
== Next

* Mongoid 5 ready! [dblock]

== 0.16.2

* Fixed a bug where cloned Relations remember previous relations'
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace :spec do
active_record_41
active_record_40
active_record_32
mongoid_50
mongoid_40
mongoid_31
mongoid_30
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/mongoid_40.gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
source 'https://rubygems.org'

gem 'railties', '~> 4.0'
gem "mongoid", "~> 4.0.0"
gem 'mongoid', '~> 4.0.0'
gem 'rspec-rails', '~> 2.14.1'

platforms :mri do
gem 'test-unit' if RUBY_VERSION > "2.1.0"
gem 'test-unit' if RUBY_VERSION > '2.1.0'
end

platforms :rbx do
Expand Down
23 changes: 23 additions & 0 deletions gemfiles/mongoid_50.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source 'https://rubygems.org'

gem 'railties', '~> 4.0'
gem 'mongoid', '~> 5.0.0'
gem 'rspec-rails', '~> 2.14.1'

group :development, :test do
# see https://github.com/DatabaseCleaner/database_cleaner/issues/390, upgrade to 1.5.1 when released
gem 'database_cleaner', github: 'DatabaseCleaner/database_cleaner'
end

platforms :mri do
gem 'test-unit' if RUBY_VERSION > '2.1.0'
end

platforms :rbx do
gem 'rubysl', '~> 2.0'
gem 'racc'
gem 'minitest'
gem 'rubinius-developer_tools'
end

gemspec :path => '../'
2 changes: 1 addition & 1 deletion kaminari.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec', ['>= 0']
s.add_development_dependency 'rr', ['>= 0']
s.add_development_dependency 'capybara', ['>= 1.0']
s.add_development_dependency 'database_cleaner', ['~> 1.2.0']
s.add_development_dependency 'database_cleaner', ['~> 1.4.1']
s.add_development_dependency 'rdoc', ['>= 0']
end
2 changes: 2 additions & 0 deletions spec/models/mongoid/mongoid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@

context "with database:", :if => Mongoid::VERSION >= '3' do
before :all do
User.with(:database => "default_db").delete_all
User.with(:database => "other_db").delete_all
15.times { User.with(:database => "default_db").create!(:salary => 1) }
10.times { User.with(:database => "other_db").create!(:salary => 1) }
end
Expand Down
7 changes: 7 additions & 0 deletions spec/support/mongoid.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RSpec.configure do |config|
config.before :suite do
# Mongoid 5 is very noisy at DEBUG level by default
Mongoid.logger.level = Logger::INFO
Mongo::Logger.logger.level = Logger::INFO if defined?(Mongo)
end
end if defined? Mongoid

0 comments on commit c806c64

Please sign in to comment.