File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,16 @@ def quote_column_name(name) #:nodoc:
150
150
%Q("#{ name } ")
151
151
end
152
152
153
+ # Quote date/time values for use in SQL input. Includes microseconds
154
+ # if the value is a Time responding to usec.
155
+ def quoted_date ( value ) #:nodoc:
156
+ if value . acts_like? ( :time ) && value . respond_to? ( :usec )
157
+ "#{ super } .#{ sprintf ( "%06d" , value . usec ) } "
158
+ else
159
+ super
160
+ end
161
+ end
162
+
153
163
154
164
# DATABASE STATEMENTS ======================================
155
165
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ def test_preserving_time_objects
456
456
)
457
457
458
458
# For adapters which support microsecond resolution.
459
- if current_adapter? ( :PostgreSQLAdapter )
459
+ if current_adapter? ( :PostgreSQLAdapter ) || current_adapter? ( :SQLiteAdapter )
460
460
assert_equal 11 , Topic . find ( 1 ) . written_on . sec
461
461
assert_equal 223300 , Topic . find ( 1 ) . written_on . usec
462
462
assert_equal 9900 , Topic . find ( 2 ) . written_on . usec
You can’t perform that action at this time.
0 commit comments