diff --git a/.gitignore b/.gitignore index f6a62fe..8e80540 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ *.rbc .config .yardoc -/Gemfile.lock InstalledFiles _yardoc coverage diff --git a/Gemfile b/Gemfile index d44cf4e..9661361 100644 --- a/Gemfile +++ b/Gemfile @@ -5,14 +5,11 @@ source 'https://rubygems.org' # development dependencies will be added by default to the :development group. gemspec -gem 'ransack', github: 'activerecord-hackery/ransack' gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid' # Test app stuff gem 'rails', '~> 5.1' -gem 'kaminari', '~> 1.0' -gem 'kaminari-mongoid' gem 'devise' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..28c86d7 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,300 @@ +GIT + remote: git://github.com/activerecord-hackery/ransack-mongoid.git + revision: bd1935293d2f285fa7cf33d2c5c90d981bf67338 + specs: + ransack-mongoid (0.1.0) + +PATH + remote: . + specs: + activeadmin-mongoid (0.8.0) + activeadmin (>= 1.3.0) + jquery-rails + kaminari-mongoid + mongoid (~> 6.0) + sass-rails (>= 3.1.4) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.2) + actionpack (= 5.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.2) + actionpack (= 5.2.2) + actionview (= 5.2.2) + activejob (= 5.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.2) + actionview (= 5.2.2) + activesupport (= 5.2.2) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.2) + activesupport (= 5.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activeadmin (1.4.3) + arbre (>= 1.1.1) + coffee-rails + formtastic (~> 3.1) + formtastic_i18n + inherited_resources (>= 1.9.0) + jquery-rails (>= 4.2.0) + kaminari (>= 0.15) + railties (>= 4.2, < 5.3) + ransack (>= 1.8.7) + sass (~> 3.1) + sprockets (< 4.1) + activejob (5.2.2) + activesupport (= 5.2.2) + globalid (>= 0.3.6) + activemodel (5.2.2) + activesupport (= 5.2.2) + activerecord (5.2.2) + activemodel (= 5.2.2) + activesupport (= 5.2.2) + arel (>= 9.0) + activestorage (5.2.2) + actionpack (= 5.2.2) + activerecord (= 5.2.2) + marcel (~> 0.3.1) + activesupport (5.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + arbre (1.1.1) + activesupport (>= 3.0.0) + arel (9.0.0) + bcrypt (3.1.12) + bson (4.3.0) + builder (3.2.3) + capybara (3.12.0) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.2) + xpath (~> 3.2) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (4.2.2) + coffee-script (>= 2.2.0) + railties (>= 4.0.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.3) + crass (1.0.4) + devise (4.5.0) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 6.0) + responders + warden (~> 1.2.3) + diff-lcs (1.3) + docile (1.3.1) + erubi (1.7.1) + execjs (2.7.0) + ffi (1.9.25) + formtastic (3.1.5) + actionpack (>= 3.2.13) + formtastic_i18n (0.6.0) + globalid (0.4.1) + activesupport (>= 4.2.0) + has_scope (0.7.2) + actionpack (>= 4.1) + activesupport (>= 4.1) + i18n (1.2.0) + concurrent-ruby (~> 1.0) + inherited_resources (1.9.0) + actionpack (>= 4.2, < 5.3) + has_scope (~> 0.6) + railties (>= 4.2, < 5.3) + responders + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + jslint (1.2.0) + json + json (2.1.0) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + kaminari-mongoid (1.0.1) + kaminari-core (~> 1.0) + mongoid + launchy (2.4.3) + addressable (~> 2.3) + loofah (2.2.3) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (0.9.2) + mimemagic (0.3.2) + mini_mime (1.0.1) + mini_portile2 (2.3.0) + minitest (5.11.3) + mongo (2.6.2) + bson (>= 4.3.0, < 5.0.0) + mongoid (6.4.2) + activemodel (>= 5.1, < 6.0.0) + mongo (>= 2.5.1, < 3.0.0) + nio4r (2.3.1) + nokogiri (1.8.5) + mini_portile2 (~> 2.3.0) + orm_adapter (0.5.0) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-rails (0.3.8) + pry (>= 0.10.4) + public_suffix (3.0.3) + rack (2.0.6) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.2) + actioncable (= 5.2.2) + actionmailer (= 5.2.2) + actionpack (= 5.2.2) + actionview (= 5.2.2) + activejob (= 5.2.2) + activemodel (= 5.2.2) + activerecord (= 5.2.2) + activestorage (= 5.2.2) + activesupport (= 5.2.2) + bundler (>= 1.3.0) + railties (= 5.2.2) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.2.2) + actionpack (= 5.2.2) + activesupport (= 5.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rake (12.3.2) + ransack (2.1.1) + actionpack (>= 5.0) + activerecord (>= 5.0) + activesupport (>= 5.0) + i18n + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + regexp_parser (1.3.0) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-rails (3.8.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + sass (3.7.2) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.9) + tzinfo (1.2.5) + thread_safe (~> 0.1) + uglifier (4.1.20) + execjs (>= 0.3.0, < 3) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + activeadmin-mongoid! + capybara + coffee-rails (~> 4.0) + devise + jquery-rails + jquery-ui-rails + jslint + launchy + poltergeist + pry-rails + rails (~> 5.1) + ransack-mongoid! + rspec-rails (~> 3.6) + sass-rails (>= 5.0.6) + simplecov + uglifier (>= 1.0.3) + +BUNDLED WITH + 1.17.1 diff --git a/README.md b/README.md index 22152f5..0a73ba1 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin * Tested working on Rails 5.1.x * Mongoid 6.x (**WARNING**:, using a Mongoid version >= 6.1.x has resulted in a fair amount of errors seen in the wild. Test your upgrade very carefully with any apps in which you're using this gem with Mongoid >= 6.1.x!) * ActiveAdmin 1.3 +* Ransack::Mongoid - it needs to explicitly declared in Gemfile with pointing to github's master since it has no releases on rubygems yet. ## Previous versions * Rails 4.x with Mongoid 5.x use branch rails4-mongoid5 @@ -36,7 +37,8 @@ For more on Mongoid support in ActiveAdmin see [this issue](https://github.com/g Add the following gems to your application's Gemfile, and lock the version: ```ruby -gem 'activeadmin-mongoid', '0.7.0' +gem 'activeadmin-mongoid', '0.8.0' +gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid' ``` You can safely remove the following lines, since are already activeadmin-mongoid dependencies: diff --git a/activeadmin-mongoid.gemspec b/activeadmin-mongoid.gemspec index 72ee753..dde727a 100644 --- a/activeadmin-mongoid.gemspec +++ b/activeadmin-mongoid.gemspec @@ -22,6 +22,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'mongoid', ['~> 6.0'] gem.add_runtime_dependency 'activeadmin', '>= 1.3.0' + gem.add_runtime_dependency 'kaminari-mongoid' gem.add_runtime_dependency 'jquery-rails' gem.add_runtime_dependency 'sass-rails', ['>= 3.1.4'] diff --git a/lib/active_admin/mongoid.rb b/lib/active_admin/mongoid.rb index bdf0384..becde41 100644 --- a/lib/active_admin/mongoid.rb +++ b/lib/active_admin/mongoid.rb @@ -2,6 +2,7 @@ require 'active_model' require 'mongoid' require 'ransack' +require 'kaminari/mongoid' # require 'active_admin/mongoid/engine' require 'active_admin' require 'devise' diff --git a/test_app/Gemfile b/test_app/Gemfile index a7366a4..34a8f86 100644 --- a/test_app/Gemfile +++ b/test_app/Gemfile @@ -1,9 +1,6 @@ source 'https://rubygems.org' gem 'activeadmin-mongoid', path: '../' -gem 'activeadmin', '~> 1.3.0' - -# Test app stuff gem 'rails', '~> 5.1.6' @@ -11,10 +8,7 @@ gem 'pry' gem 'devise' -gem 'mongoid', '~> 6.0.3', require: true -gem 'kaminari', '~> 1.0' -gem 'kaminari-mongoid' -gem 'ransack', '< 1.8.7' +gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid' gem 'sprockets', '>= 3.7.2' diff --git a/test_app/Gemfile.lock b/test_app/Gemfile.lock index 52b7b2e..d7f5e3e 100644 --- a/test_app/Gemfile.lock +++ b/test_app/Gemfile.lock @@ -1,60 +1,67 @@ +GIT + remote: git://github.com/activerecord-hackery/ransack-mongoid.git + revision: bd1935293d2f285fa7cf33d2c5c90d981bf67338 + specs: + ransack-mongoid (0.1.0) + PATH remote: .. specs: activeadmin-mongoid (0.8.0) activeadmin (>= 1.3.0) jquery-rails + kaminari-mongoid mongoid (~> 6.0) sass-rails (>= 3.1.4) GEM remote: https://rubygems.org/ specs: - actioncable (5.1.6) - actionpack (= 5.1.6) + actioncable (5.1.6.1) + actionpack (= 5.1.6.1) nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) + actionmailer (5.1.6.1) + actionpack (= 5.1.6.1) + actionview (= 5.1.6.1) + activejob (= 5.1.6.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.6) - actionview (= 5.1.6) - activesupport (= 5.1.6) + actionpack (5.1.6.1) + actionview (= 5.1.6.1) + activesupport (= 5.1.6.1) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.6) - activesupport (= 5.1.6) + actionview (5.1.6.1) + activesupport (= 5.1.6.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activeadmin (1.3.0) + activeadmin (1.4.3) arbre (>= 1.1.1) coffee-rails formtastic (~> 3.1) formtastic_i18n - inherited_resources (>= 1.7.0) + inherited_resources (>= 1.9.0) jquery-rails (>= 4.2.0) kaminari (>= 0.15) railties (>= 4.2, < 5.3) - ransack (~> 1.3) + ransack (>= 1.8.7) sass (~> 3.1) sprockets (< 4.1) - activejob (5.1.6) - activesupport (= 5.1.6) + activejob (5.1.6.1) + activesupport (= 5.1.6.1) globalid (>= 0.3.6) - activemodel (5.1.6) - activesupport (= 5.1.6) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) + activemodel (5.1.6.1) + activesupport (= 5.1.6.1) + activerecord (5.1.6.1) + activemodel (= 5.1.6.1) + activesupport (= 5.1.6.1) arel (~> 8.0) - activesupport (5.1.6) + activesupport (5.1.6.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -67,13 +74,14 @@ GEM bcrypt (3.1.12) bson (4.3.0) builder (3.2.3) - capybara (2.15.1) + capybara (3.12.0) addressable mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.2) + xpath (~> 3.2) cliver (0.3.2) coderay (1.1.2) coffee-rails (4.2.2) @@ -83,15 +91,15 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.3) crass (1.0.4) - devise (4.4.3) + devise (4.5.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 6.0) responders warden (~> 1.2.3) - docile (1.1.5) + docile (1.3.1) erubi (1.7.1) execjs (2.7.0) ffi (1.9.25) @@ -103,12 +111,12 @@ GEM has_scope (0.7.2) actionpack (>= 4.1) activesupport (>= 4.1) - i18n (1.0.1) + i18n (1.2.0) concurrent-ruby (~> 1.0) - inherited_resources (1.8.0) - actionpack (>= 4.2, <= 5.2) + inherited_resources (1.9.0) + actionpack (>= 4.2, < 5.3) has_scope (~> 0.6) - railties (>= 4.2, <= 5.2) + railties (>= 4.2, < 5.3) responders jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) @@ -139,88 +147,84 @@ GEM loofah (2.2.3) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.0) + mail (2.7.1) mini_mime (>= 0.1.1) - method_source (0.8.2) - mini_mime (0.1.4) + method_source (0.9.2) + mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) - mongo (2.5.1) + mongo (2.6.2) bson (>= 4.3.0, < 5.0.0) - mongoid (6.0.3) - activemodel (~> 5.0) - mongo (~> 2.3) - nio4r (2.3.0) + mongoid (6.4.2) + activemodel (>= 5.1, < 6.0.0) + mongo (>= 2.5.1, < 3.0.0) + nio4r (2.3.1) nokogiri (1.8.5) mini_portile2 (~> 2.3.0) orm_adapter (0.5.0) - poltergeist (1.16.0) - capybara (~> 2.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - polyamorous (1.3.3) - activerecord (>= 3.0) - pry (0.10.4) + pry (0.12.2) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - public_suffix (3.0.0) + method_source (~> 0.9.0) + public_suffix (3.0.3) rack (2.0.6) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.1.6) - actioncable (= 5.1.6) - actionmailer (= 5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - activemodel (= 5.1.6) - activerecord (= 5.1.6) - activesupport (= 5.1.6) + rails (5.1.6.1) + actioncable (= 5.1.6.1) + actionmailer (= 5.1.6.1) + actionpack (= 5.1.6.1) + actionview (= 5.1.6.1) + activejob (= 5.1.6.1) + activemodel (= 5.1.6.1) + activerecord (= 5.1.6.1) + activesupport (= 5.1.6.1) bundler (>= 1.3.0) - railties (= 5.1.6) + railties (= 5.1.6.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (5.1.6) - actionpack (= 5.1.6) - activesupport (= 5.1.6) + railties (5.1.6.1) + actionpack (= 5.1.6.1) + activesupport (= 5.1.6.1) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (12.3.1) - ransack (1.8.6) - actionpack (>= 3.0) - activerecord (>= 3.0) - activesupport (>= 3.0) + rake (12.3.2) + ransack (2.1.1) + actionpack (>= 5.0) + activerecord (>= 5.0) + activesupport (>= 5.0) i18n - polyamorous (~> 1.3.2) rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) + regexp_parser (1.3.0) responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) - sass (3.5.6) + sass (3.7.2) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.6) + sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - simplecov (0.15.1) - docile (~> 1.1.0) + simplecov (0.16.1) + docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - slop (3.6.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -228,26 +232,25 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - thor (0.20.0) + thor (0.20.3) thread_safe (0.3.6) - tilt (2.0.8) + tilt (2.0.9) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (3.2.0) + uglifier (4.1.20) execjs (>= 0.3.0, < 3) - warden (1.2.7) - rack (>= 1.0) + warden (1.2.8) + rack (>= 2.0.6) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) - xpath (2.1.0) - nokogiri (~> 1.3) + xpath (3.2.0) + nokogiri (~> 1.8) PLATFORMS ruby DEPENDENCIES - activeadmin (~> 1.3.0) activeadmin-mongoid! capybara coffee-rails @@ -255,14 +258,11 @@ DEPENDENCIES jquery-rails jquery-ui-rails jslint - kaminari (~> 1.0) - kaminari-mongoid launchy - mongoid (~> 6.0.3) poltergeist pry rails (~> 5.1.6) - ransack (< 1.8.7) + ransack-mongoid! sass-rails simplecov sprockets (>= 3.7.2)