bullet
bullet copied to clipboard
Add MongoID 7 support
(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
Any updates on Mongoid 7 support? :)
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
sorry, I'm not working on any mongoid project, will try mongoid 7 when I'm free.