Skip to content

Commit c8ddeff

Browse files
committed
Manually map Date/TimeStamp results to raw string
1 parent cfd8fbf commit c8ddeff

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

lib/odbc_adapter/database_statements.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,17 @@ def default_sequence_name(table, _column)
7979
# A custom hook to allow end users to overwrite the type casting before it
8080
# is returned to ActiveRecord. Useful before a full adapter has made its way
8181
# back into this repository.
82-
def dbms_type_cast(_columns, values)
83-
values
82+
def dbms_type_cast(_columns, rows)
83+
rows.map do |values|
84+
values.map do |value|
85+
case value
86+
when ODBC::Date, ODBC::TimeStamp
87+
value.to_s
88+
else
89+
value
90+
end
91+
end
92+
end
8493
end
8594

8695
# Assume received identifier is in DBMS's data dictionary case.

0 commit comments

Comments
 (0)