lib/mongoid/extensions/time_with_zone.rb
# This code is copied from Time class extension in bson-ruby gem. It
# should be removed from here when added to bson-ruby.
# See https://jira.mongodb.org/browse/RUBY-2846.
This code is copied from Time class extension in bson-ruby gem. It
should be removed from here when added to bson-ruby.
This code is copied from Time class extension in bson - ruby gem . It should be removed from here when added to bson - ruby .
def _bson_to_i
        if BSON::Environment.jruby?
          (self - usec.to_r/1000000).to_i
        else
          to_i
        end
      end
def _bson_to_i if BSON :: Environment . jruby? ( self - usec . to_r / 1000000 ) . to_i else to_i end end
This code is copied from Time class extension in bson-ruby gem.
This code is copied from Time class extension in bson - ruby gem .
# Workaround for JRuby's #to_i rounding negative timestamps up # rather than down (https://github.com/jruby/jruby/issues/6104)