This is poor DX:
speed% irb -rmongoid irb(main):001:0> Mongoid::Config.log_level => 1 irb(main):002:0> Mongoid::Config.log_level=2 => 2 irb(main):003:0> Mongoid::Config.log_level Traceback (most recent call last): 3: from /home/w/.rbenv/versions/2.5.1/bin/irb:11:in `<main>' 2: from (irb):3 1: from /home/w/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mongoid-7.0.1/lib/mongoid/config/options.rb:83:in `log_level' NoMethodError (undefined method `upcase' for 2:Integer)
If log_level is returned as an integer it should be accepted as an integer as well by the attribute writer.