From e27e9d39704be83c5d1b2f3a3040747fada900e7 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 29 Dec 2023 11:44:47 -0800 Subject: [PATCH] Don't use alias for method that calls super Define a separate method instead, so that super goes to the correct method. --- lib/sequel/extensions/auto_cast_date_and_time.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/sequel/extensions/auto_cast_date_and_time.rb b/lib/sequel/extensions/auto_cast_date_and_time.rb index cf4aec030..5ed9acbdb 100644 --- a/lib/sequel/extensions/auto_cast_date_and_time.rb +++ b/lib/sequel/extensions/auto_cast_date_and_time.rb @@ -57,18 +57,23 @@ def requires_sql_standard_datetimes? private - # Explicitly cast SQLTime time objects to TIME. + # Explicitly cast SQLTime objects to TIME. def literal_sqltime_append(sql, v) sql << "TIME " super end - # Explicitly cast Time time objects to TIMESTAMP. + # Explicitly cast Time objects to TIMESTAMP. def literal_time_append(sql, v) sql << literal_datetime_timestamp_cast super end - alias literal_datetime_append literal_time_append + + # Explicitly cast DateTime objects to TIMESTAMP. + def literal_datetime_append(sql, v) + sql << literal_datetime_timestamp_cast + super + end # Explicitly cast Date objects to DATE. def literal_date_append(sql, v)