module Mongoid::Extensions::TimeWithZone
def __mongoize_time__
-
(ActiveSupport::TimeWithZone)- self.
def __mongoize_time__ self end
def _bson_to_i
should be removed from here when the minimum BSON version is 5+.
This code is copied from Time class extension in bson-ruby gem. It
def _bson_to_i return super if defined?(super) # Workaround for JRuby's #to_i rounding negative timestamps up # rather than down (https://github.com/jruby/jruby/issues/6104) if BSON::Environment.jruby? (self - usec.to_r/1000000).to_i else to_i end end
def mongoize
-
(Time)- The object mongoized.
Other tags:
- Example: Mongoize the object. -
def mongoize ::ActiveSupport::TimeWithZone.mongoize(self) end