ruby / date

A subclass of Object includes Comparable module for handling dates.
Other
70 stars 35 forks source link

DateTime object not comparable with ActiveSupport::TimeWithZone? #95

Closed ssoulless closed 1 year ago

ssoulless commented 1 year ago

This expectation started to fail after I installed this gem v.3.3.3

# order.purchased_at = Sun, 26 Jan 0020 00:00:00 UTC +00:00
# order.purchased_at.class == ActiveSupport::TimeWithZone
expect(order.purchased_at).to eq 'Sun, 26 Jan 0020 00:00:00 UTC +00:00'.to_datetime

If I remove this gem the expectation passes

jeremyevans commented 1 year ago

The date library does not define String#to_datetime. You should probably report this to the ActiveSupport maintainers. If you think this is a bug in date itself, please post a self contained example that does not use ActiveSupport.