bullet icon indicating copy to clipboard operation
bullet copied to clipboard

Add MongoID 7 support

Open PikachuEXE opened this issue 8 years ago • 3 comments

(7.0 is out)[https://github.com/mongodb/mongoid/releases/tag/v7.0.0]

Side topic: How I handle bullet in this case

config/initializers/bullet.rb

# frozen_string_literal: true

begin
  require "bullet"
rescue ::LoadError
  # Do nothing, it's normal to be absent in some environments
rescue ::RuntimeError => ex
  # Only catch specific errors
  raise(ex) unless ex.message.match?(/Bullet does not support/)
  # Do nothing, it's normal have "unsupported yet" errors, like mongoid
else
  ::Bullet.enable = true

  # Log it, but don't show alert
  # Even you do want it don't check the config change in
  # ::Bullet.alert = true
  ::Bullet.bullet_logger = true
  # javascript console (Safari/Webkit browsers or Firefox w/Firebug installed)
  ::Bullet.console = true
  # Log to rails logger
  ::Bullet.rails_logger = true


  # Config for what to show
  ::Bullet.n_plus_one_query_enable = true
  ::Bullet.unused_eager_loading_enable = false
  ::Bullet.counter_cache_enable = true
end

PikachuEXE avatar Mar 15 '18 03:03 PikachuEXE

Any updates on Mongoid 7 support? :)

rgaufman avatar May 25 '18 18:05 rgaufman

I wrote a commit for Mongo 7 But the spec for unused association failed and I don't know how to fix

You can run test with BUNDLE_GEMFILE=Gemfile.mongoid-7.0 bundle exec rspec spec

PikachuEXE avatar May 28 '18 02:05 PikachuEXE

sorry, I'm not working on any mongoid project, will try mongoid 7 when I'm free.

flyerhzm avatar May 28 '18 05:05 flyerhzm