Closed ipvalverde closed 1 month ago
Active Support is not only used in Rails applications, so making the return type fit just a majority of Rails applications is problematic in my opinion.
Since this is dynamic and the return value depends on the presence of Time.zone
, I'd rather that we create a DSL compiler for this in Tapioca which would create the right signature for the application it is working against.
I just created a PR for the compiler, btw: https://github.com/Shopify/tapioca/pull/1962
Shall we close this draft then?
Type of Change
Changes
activesupport
Description
Fixes https://github.com/Shopify/rbi-central/issues/261
Although the documentation does indicate that
Time.current
should be able to return aTime
object this is unlikely to happen in a Rails application. This PR is to mitigate the need of extra code from consumers that might want to assign the return ofTime.current
to aTimeWithZone
.Ideally we should make the
TimeWithZone
to inherit fromTime
, since it hacks its way to be like aTime
, but this was failing CI and it can be in a different PR.