diff --git a/Gemfile b/Gemfile index 0a70804..276f673 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,6 @@ else end end -if ENV['DB'] == 'mongodb' +if ENV['DB'] =~ /mongodb/ gem 'mongoid', '~> 4.0.0', require: false end diff --git a/Rakefile b/Rakefile index 10269b3..cc76efa 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,13 @@ RSpec::Core::RakeTask.new(:mongoid) do |rspec| rspec.rspec_opts = ['--backtrace'] end -task :default => :spec +task :default do + if ENV['DB'] =~ /mongodb/ + Rake::Task["mongoid"].invoke + else + Rake::Task["spec"].invoke + end +end desc "Open an irb session with Ransack and the sample data used in specs" task :console do