Skip to content

Commit

Permalink
Don't use alias for method that calls super
Browse files Browse the repository at this point in the history
Define a separate method instead, so that super goes to the
correct method.
  • Loading branch information
jeremyevans committed Dec 29, 2023
1 parent 764c774 commit e27e9d3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/sequel/extensions/auto_cast_date_and_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e27e9d3

Please sign in to comment.