-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveSupport::TimeWithZone
gets converted to DateTime
during coercion
#53913
Comments
A number of points:
|
Thanks for the reply @pixeltrix. Didn't get a chance to look into this last week. Here's what I noticed about your suggestions.
|
Steps to reproduce
Expected behavior
The spec should pass because the
other
argument passed to<=>
should be the same object that was sent the<=>
message, instead it is an instance ofDateTime
.DateTime
doesn't have the zone information, it ends up returning wrong values when callingstrftime
on it.ActiveSupport::TimeWithZone
Actual behavior
The
<=>
method of theCustomDateTime
class receives an instance ofDateTime
.System configuration
Rails version: 7.0.8.5
Ruby version: 3.2.4
The text was updated successfully, but these errors were encountered: