You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When returning a datetime field in the :returning block, the field will come back as a string and not as a casted date.
I've got an additional method that calls ::User.type_for_attribute(:verified_at).cast(value) which returns an ActiveSupport::TimeWithZone object but I am unsure if this is intentional behavior or just a bug, the rest of the columns appear to be properly cast though.
The text was updated successfully, but these errors were encountered:
skunkworker
changed the title
Datetime field in "returning" sends back string and not casted value.
Datetime field in "returning" sends back string and not casted ActiveSupport::TimeWithZone value.
Jul 29, 2020
No typecasting is done on the returning values within ActiveRecord-Import. If you would like to investigate adding support for that, I think that would be a nice feature...but I also don't think it's completely unreasonable require casting/parsing the returning values either.
Have you done any benchmarks to see how parsing compares to casting in your example?
I'm using
1.0.5
with Postgres 12.3.When returning a datetime field in the
:returning
block, the field will come back as a string and not as a casted date.I've got an additional method that calls
::User.type_for_attribute(:verified_at).cast(value)
which returns anActiveSupport::TimeWithZone
object but I am unsure if this is intentional behavior or just a bug, the rest of the columns appear to be properly cast though.The text was updated successfully, but these errors were encountered: