aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sybase_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sybase_adapter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb b/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb
index 708a11b230..45b5d0bc96 100644
--- a/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb
@@ -292,8 +292,12 @@ SQLTEXT
when TrueClass then '1'
when FalseClass then '0'
when Float, Fixnum, Bignum then force_numeric?(column) ? value.to_s : "'#{value.to_s}'"
- when Time, DateTime then "'#{value.strftime("%Y-%m-%d %H:%M:%S")}'"
- else super
+ else
+ if value.acts_like?(:time)
+ "'#{value.strftime("%Y-%m-%d %H:%M:%S")}'"
+ else
+ super
+ end
end
end