@@ -354,6 +354,11 @@ def assert_obj_set_and_save(attribute, value)
354354 obj . datetime2_7 . must_equal Time . utc ( 9999 , 12 , 31 , 23 , 59 , 59 , Rational ( 123456800 , 1000 ) ) , "Nanoseconds were <#{ obj . datetime2_7 . nsec } > vs <123456800>"
355355 obj . save!
356356 obj . reload . datetime2_7 . must_equal Time . utc ( 9999 , 12 , 31 , 23 , 59 , 59 , Rational ( 123456800 , 1000 ) ) , "Nanoseconds were <#{ obj . datetime2_7 . nsec } > vs <123456800>"
357+ # Can save small fraction nanosecond precisoins and return again.
358+ obj . datetime2_7 = Time . utc ( 2008 , 6 , 21 , 13 , 30 , 0 , Rational ( 15020 , 1000 ) )
359+ obj . datetime2_7 . must_equal Time . utc ( 2008 , 6 , 21 , 13 , 30 , 0 , Rational ( 15000 , 1000 ) ) , "Nanoseconds were <#{ obj . datetime2_7 . nsec } > vs <15000>"
360+ obj . save!
361+ obj . reload . datetime2_7 . must_equal Time . utc ( 2008 , 6 , 21 , 13 , 30 , 0 , Rational ( 15000 , 1000 ) ) , "Nanoseconds were <#{ obj . datetime2_7 . nsec } > vs <15000>"
357362 # With other precisions.
358363 time = Time . utc 9999 , 12 , 31 , 23 , 59 , 59 , Rational ( 123456789 , 1000 )
359364 col = column ( 'datetime2_3' )
0 commit comments