Permalink
Browse files

Fix literalization of Date, Time, and DateTime values on Microsoft Ac…

…cess
  • Loading branch information...
1 parent 1aaf41c commit f36da00ff6d4f25fba4c680d7bf4a3f827ca9951 @jeremyevans jeremyevans committed Jul 12, 2011
Showing with 13 additions and 0 deletions.
  1. +2 −0 CHANGELOG
  2. +11 −0 lib/sequel/adapters/shared/access.rb
View
@@ -1,5 +1,7 @@
=== HEAD
+* Fix literalization of Date, Time, and DateTime values on Microsoft Access (jeremyevans)
+
* Fix handling of nil values with the pure-Java version of nokogiri in the xml_serializer plugin (jeremyevans)
* Make identity_map plugin work with standard eager loading of many_to_many and many_through_many associations (jeremyevans)
@@ -43,6 +43,17 @@ def supports_intersect_except?
private
+ # Access uses # to quote dates
+ def literal_date(d)
+ d.strftime('#%Y-%m-%d#')
+ end
+
+ # Access uses # to quote datetimes
+ def literal_datetime(t)
+ t.strftime('#%Y-%m-%d %H:%M:%S#')
+ end
+ alias literal_time literal_datetime
+
# Access uses TOP for limits
def select_limit_sql(sql)
sql << " TOP #{@opts[:limit]}" if @opts[:limit]

0 comments on commit f36da00

Please sign in to comment.