-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Query
We need to have a test in Mongoid that sends a query on a (driver) collection using a TimeWithZone object like this:
good_time = Time.now bad_time = Time.now.in_time_zone("Pacific Time (US & Canada)") User.collection.find(:u_at => {:$lt => bad_time}).to_a.length # this query will be wrong # the problem is that: good_time.to_bson != bad_time.to_bson
... and verifies correct results.
As well, Mongoid will need to require 'bson/active_support' as added in https://github.com/mongodb/bson-ruby/pull/104.
These changes should be backported to 6 and 7 stable branches.
- depends on
-
RUBY-1464 Time offset ignored in aggregation queries when using ActiveSupport::TimeWithZone
- Closed
- is related to
-
MONGOID-4770 Mongoid does not automatically require driver ActiveSupport compatibility
- Closed
- related to
-
RUBY-1529 Support ActiveSupport::TimeWithZone serialization to BSON on bson-ruby level
- Closed
- links to