Ticket #7034: use_db_format_to_quote_dates.diff
| File use_db_format_to_quote_dates.diff, 1.0 kB (added by jeremymcanally, 2 years ago) |
|---|
-
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
old new 24 24 when Float, Fixnum, Bignum then value.to_s 25 25 # BigDecimals need to be output in a non-normalized form and quoted. 26 26 when BigDecimal then value.to_s('F') 27 when Date then "'#{value.to_ s}'"27 when Date then "'#{value.to_formatted_s(:db)}'" 28 28 when Time, DateTime then "'#{quoted_date(value)}'" 29 29 else "'#{quote_string(value.to_yaml)}'" 30 30 end … … 51 51 end 52 52 53 53 def quoted_date(value) 54 value. strftime("%Y-%m-%d %H:%M:%S")54 value.to_formatted_s(:db) 55 55 end 56 56 end 57 57 end